mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Fix for a crash which occurs when NPCs pick up a weapon the player is already holding
This commit is contained in:
@@ -11495,6 +11495,14 @@ bool CAI_BaseNPC::ChooseEnemy( void )
|
||||
//=========================================================
|
||||
void CAI_BaseNPC::PickupWeapon( CBaseCombatWeapon *pWeapon )
|
||||
{
|
||||
#ifdef MAPBASE
|
||||
if ( pWeapon->VPhysicsGetObject() && pWeapon->VPhysicsGetObject()->GetGameFlags() & FVPHYSICS_PLAYER_HELD )
|
||||
{
|
||||
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
|
||||
pPlayer->ForceDropOfCarriedPhysObjects( pWeapon );
|
||||
}
|
||||
#endif
|
||||
|
||||
pWeapon->OnPickedUp( this );
|
||||
Weapon_Equip( pWeapon );
|
||||
m_iszPendingWeapon = NULL_STRING;
|
||||
|
||||
Reference in New Issue
Block a user