-
Notifications
You must be signed in to change notification settings - Fork 2.6k
all games: Add sv_infinite_ammo ConVar #1211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Should be fixed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work perfectly for guns.
If you want to refill Soldier banners and rage meters (Soda Popper, Phog, Hitman's Heatmaker, etc) the simpler way to do it would be by calling CTFPlayerShared::SetItemChargeMeter
on every weapon slot. This is what impulse 101
does:
source-sdk-2013/src/game/server/tf/tf_player.cpp
Lines 14760 to 14766 in 0565403
m_Shared.m_flRageMeter = 100.f; | |
m_Shared.SetDemomanChargeMeter( 100.f ); | |
for( int i = FIRST_LOADOUT_SLOT_WITH_CHARGE_METER; i <= LAST_LOADOUT_SLOT_WITH_CHARGE_METER; ++i ) | |
{ | |
m_Shared.SetItemChargeMeter( (loadout_positions_t)i, 100.f ); | |
} |
Added your suggested changes, thanks! Although the |
That may have just been an issue with my testing setup, then. |
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.