all games: Add sv_infinite_ammo ConVar
This PR implements the sv_infinite_ammo cheat-protected ConVar from Left 4 Dead/Alien Swarm. When enabled, it prevents the player's active weapon from depleting ammo.
Furthermore, added functionality from Counter-Strike : GO where setting the ConVar to 2 or higher will only replenish the weapon's reserve (so the player still has to reload).
In Team Fortress 2, it also refills metal and weapon/item charges.
Closes:
- https://github.com/ValveSoftware/Source-1-Games/issues/3673
- https://github.com/ValveSoftware/Source-1-Games/issues/3828
This doesn't seem to work with energy weapons in TF2
Should be fixed now
Added your suggested changes, thanks! Although the SetScoutHypeMeter call is still needed as the Soda Popper charge doesn't seem to be affected by SetRageMeter and SetItemChargeMeter (impulse 101 doesn't affect it either).
That may have just been an issue with my testing setup, then.
Should infinite ammo apply to charge meters? Non-weapons in general? Shouldn't that be handled by something separate?
Should infinite ammo apply to charge meters? Non-weapons in general? Shouldn't that be handled by something separate?
I think in most use cases where this ConVar would be used in it might be preferred to refill charges as well.
Additionally, a lot of the charge meters already can be refilled with ammo pickups.