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 3, 2018
1 parent 238db2b commit 9652308
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 @@ -1554,6 +1554,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 @@ -1577,7 +1579,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 9652308

Please sign in to comment.