by Spike » Fri Sep 16, 2011 4:05 am
the easy way to do 1 secondary weapon is to say 'mneh, they're just all mutually exclusive' and clear out all secondary weapon bits upon secondary weapon pickup, just before setting the flag.
the lame way to do 2 primary weapons is to say 'mneh, they're nearly all mutually exclusive' and clear out all primary weapon bits except for the next numerically higher (rotated) weapon bit which you already have, but otherwise same idea as for secondary weapons. This will mean that if you have the sg+rl, and you grab the ng, it drops the sg. if you grabbed the lg, it drops the rl. well, it works without lots of extra fields at least. you could retain the next numerically lower instead if you wanted slightly more obvious grabbing. it'll be 0 or 1 bits cleared depending on how many you currently have, of course, hence why its easier to retain the first found and clear any others.
then you've still got the .weapon/.items fields for a working hud and stuff.
.