mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-13 15:27:56 +03:00
Fix for a crash which occurs when NPCs pick up a weapon the player is already holding
This commit is contained in:
parent
85097e119e
commit
f61b933ed3
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user