From 148035ce3151d377807dd396e1d70df277c9de6c Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 16:56:29 +0300 Subject: [PATCH] game: fixed npc_manhack not notifying npc_template_maker/npc_maker when thrown and destroyed with gravity gun. (ValveSoftware/source-sdk-2013#362) --- game/server/hl2/npc_manhack.cpp | 6 +++++- game/server/hl2/npc_manhack.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/game/server/hl2/npc_manhack.cpp b/game/server/hl2/npc_manhack.cpp index feef84f8b7..77cd633706 100644 --- a/game/server/hl2/npc_manhack.cpp +++ b/game/server/hl2/npc_manhack.cpp @@ -3007,6 +3007,8 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r } else { + m_pPrevOwner.Set( GetOwnerEntity() ); + // Suppress collisions between the manhack and the player; we're currently bumping // almost certainly because it's not purely a physics object. SetOwnerEntity( pPhysGunUser ); @@ -3022,8 +3024,10 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r //----------------------------------------------------------------------------- void CNPC_Manhack::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason ) { + SetOwnerEntity( m_pPrevOwner.Get() ); + // Stop suppressing collisions between the manhack and the player - SetOwnerEntity( NULL ); + m_pPrevOwner.Set( NULL ); m_bHeld = false; diff --git a/game/server/hl2/npc_manhack.h b/game/server/hl2/npc_manhack.h index 17a3cedb18..761ccd4a34 100644 --- a/game/server/hl2/npc_manhack.h +++ b/game/server/hl2/npc_manhack.h @@ -254,6 +254,7 @@ private: CSprite *m_pLightGlow; CHandle m_hSmokeTrail; + CHandle m_pPrevOwner; int m_iPanel1; int m_iPanel2;