[No] Unrestrict Check/DepleteAmmo's "ammocount" parameter

Moderator: GZDoom Developers

Unrestrict Check/DepleteAmmo's "ammocount" parameter

Postby Major Cooke » Thu Aug 30, 2018 2:08 pm

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))
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

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

Postby Graf Zahl » Thu Aug 30, 2018 2:30 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Major Cooke » Thu Aug 30, 2018 2:49 pm

...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!
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests