game: fixed npc_manhack not notifying npc_template_maker/npc_maker when thrown and destroyed with gravity gun. (ValveSoftware/source-sdk-2013#362)

This commit is contained in:
SanyaSho 2022-08-16 16:56:29 +03:00
parent 21c54015a2
commit 148035ce31
2 changed files with 6 additions and 1 deletions

View File

@ -3007,6 +3007,8 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
} }
else else
{ {
m_pPrevOwner.Set( GetOwnerEntity() );
// Suppress collisions between the manhack and the player; we're currently bumping // Suppress collisions between the manhack and the player; we're currently bumping
// almost certainly because it's not purely a physics object. // almost certainly because it's not purely a physics object.
SetOwnerEntity( pPhysGunUser ); SetOwnerEntity( pPhysGunUser );
@ -3022,8 +3024,10 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CNPC_Manhack::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason ) void CNPC_Manhack::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason )
{ {
SetOwnerEntity( m_pPrevOwner.Get() );
// Stop suppressing collisions between the manhack and the player // Stop suppressing collisions between the manhack and the player
SetOwnerEntity( NULL ); m_pPrevOwner.Set( NULL );
m_bHeld = false; m_bHeld = false;

View File

@ -254,6 +254,7 @@ private:
CSprite *m_pLightGlow; CSprite *m_pLightGlow;
CHandle<SmokeTrail> m_hSmokeTrail; CHandle<SmokeTrail> m_hSmokeTrail;
CHandle<CBaseEntity> m_pPrevOwner;
int m_iPanel1; int m_iPanel1;
int m_iPanel2; int m_iPanel2;