Unrestrict Check/DepleteAmmo's "ammocount" parameter

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Unrestrict Check/DepleteAmmo's "ammocount" parameter

Post 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 all

else if (ammocount >= 0 && (WeaponFlags & WIF_DEHAMMO))
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

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

Post 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.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

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

Post 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!
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”