Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/game/server/neo/neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2250,12 +2250,6 @@ bool CNEO_Player::Weapon_CanSwitchTo(CBaseCombatWeapon *pWeapon)

bool CNEO_Player::BumpWeapon( CBaseCombatWeapon *pWeapon )
{
// We had some cases of dead players chilling around with visible guns.
// While that will be addressed in ShouldDraw, here's a preventive measure
// to avoid that situation from occurring altogether.
if (IsDead())
return false;

auto weaponSlot = pWeapon->GetSlot();
// Only pick up grenades if we don't have grenades of that type NEOTODO (Adam) What if we have less than the maximum of that type (i.e one smoke grenade)? Can I carry more of a grenade than I spawn with?
if (weaponSlot == 3 && Weapon_GetPosition(weaponSlot, pWeapon->GetPosition()))
Expand All @@ -2278,7 +2272,16 @@ bool CNEO_Player::BumpWeapon( CBaseCombatWeapon *pWeapon )
}
}

return BaseClass::BumpWeapon(pWeapon);
// We need to run this for its side-effects, even in the IsDead case below... should be refactored.
const bool okRet = BaseClass::BumpWeapon(pWeapon);

// We had some cases of dead players chilling around with visible guns.
// While that will be addressed in ShouldDraw, here's a preventive measure
// to avoid that situation from occurring altogether.
if (IsDead())
return false;

return okRet;
}

bool CNEO_Player::Weapon_GetPosition(int slot, int position)
Expand Down
Loading