Skip to content

Commit

Permalink
Disable the overflow weapon drop mechanism by default
Browse files Browse the repository at this point in the history
Can be re-enabled by setting da_drop_overflow_on_pickup to 1.
  • Loading branch information
TomyLobo committed Nov 13, 2018
1 parent 6022e03 commit 5d060c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mp/src/game/shared/sdk/weapon_sdkbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,8 @@ void CWeaponSDKBase::ItemPostFrame( void )
}
}

ConVar da_drop_overflow_on_pickup("da_drop_overflow_on_pickup", "0", FCVAR_ARCHIVE | FCVAR_USERINFO | FCVAR_CLIENTDLL, "Enable to drop weapons in order to make room for what you pick up.");

extern bool UTIL_ItemCanBeTouchedByPlayer( CBaseEntity *pItem, CBasePlayer *pPlayer );

void CWeaponSDKBase::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
Expand All @@ -1581,7 +1583,7 @@ void CWeaponSDKBase::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP

int iWeight = GetWeight();

if (iWeight + pPlayer->FindCurrentWeaponsWeight() > MAX_LOADOUT_WEIGHT)
if (da_drop_overflow_on_pickup.GetBool() && iWeight + pPlayer->FindCurrentWeaponsWeight() > MAX_LOADOUT_WEIGHT)
pPlayer->DropWeaponsToPickUp(this);

if (iWeight + pPlayer->FindCurrentWeaponsWeight() > MAX_LOADOUT_WEIGHT)
Expand Down

0 comments on commit 5d060c7

Please sign in to comment.