Page 1 of 1

Unrestrict Check/DepleteAmmo's "ammocount" parameter

PostPosted: Thu Aug 30, 2018 1:08 pm
by Major Cooke
CheckAmmo's and DepleteAmmo's "ammocount" parameter is limited to only DEH ammo it seems. It'd be nice to use this without having to screw with the current AmmoUse properties just to fake it.

Line 262 in a_weapons.cpp:
Code: Select allExpand view
else if (ammocount >= 0 && (WeaponFlags & WIF_DEHAMMO))

Re: Unrestrict Check/DepleteAmmo's "ammocount" parameter

PostPosted: Thu Aug 30, 2018 1:30 pm
by Graf Zahl
Can't do. This would break the entire thing. This parameter is needed to pass default ammo use values for dehacked modifiable weapons to the function via DepleteAmmo and is being used by all of Doom's original attack functions.

Re: Unrestrict Check/DepleteAmmo's "ammocount" parameter

PostPosted: Thu Aug 30, 2018 1:49 pm
by Major Cooke
...Oh wait a minute, I just realized it's a virtual. I'll just override that and switch the AmmoUse parameters temporarily whenever it's using just primary or secondary for the amounts, run the super function and then swap back.

Fair enough. Glad it's a virtual at least!