mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-15 14:02:30 +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 )
|
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 );
|
pWeapon->OnPickedUp( this );
|
||||||
Weapon_Equip( pWeapon );
|
Weapon_Equip( pWeapon );
|
||||||
m_iszPendingWeapon = NULL_STRING;
|
m_iszPendingWeapon = NULL_STRING;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user