Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions mp/src/game/server/hl2/npc_manhack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3007,6 +3007,9 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
}
else
{
// FIX: Remember the current owner in case we are from a npc_template_maker/npc_maker.
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 );
Expand All @@ -3022,8 +3025,11 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
//-----------------------------------------------------------------------------
void CNPC_Manhack::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason )
{
// Stop suppressing collisions between the manhack and the player
SetOwnerEntity( NULL );
// Stop suppressing collisions between the manhack and the player
SetOwnerEntity(m_pPrevOwner.Get());

// Reset previous owner back to NULL.
m_pPrevOwner.Set(NULL);

m_bHeld = false;

Expand Down
1 change: 1 addition & 0 deletions mp/src/game/server/hl2/npc_manhack.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ DECLARE_SERVERCLASS();
CSprite *m_pLightGlow;

CHandle<SmokeTrail> m_hSmokeTrail;
CHandle<CBaseEntity> m_pPrevOwner;

int m_iPanel1;
int m_iPanel2;
Expand Down
12 changes: 9 additions & 3 deletions sp/src/game/server/hl2/npc_manhack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3007,9 +3007,12 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
}
else
{
// FIX: Remember the current owner in case we are from a npc_template_maker/npc_maker.
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 );
SetOwnerEntity(pPhysGunUser);
m_bHeld = true;
}
}
Expand All @@ -3022,8 +3025,11 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
//-----------------------------------------------------------------------------
void CNPC_Manhack::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason )
{
// Stop suppressing collisions between the manhack and the player
SetOwnerEntity( NULL );
// Stop suppressing collisions between the manhack and the player
SetOwnerEntity(m_pPrevOwner.Get());

// Reset previous owner back to NULL.
m_pPrevOwner.Set(NULL);

m_bHeld = false;

Expand Down
1 change: 1 addition & 0 deletions sp/src/game/server/hl2/npc_manhack.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ DECLARE_SERVERCLASS();
CSprite *m_pLightGlow;

CHandle<SmokeTrail> m_hSmokeTrail;
CHandle<CBaseEntity> m_pPrevOwner;

int m_iPanel1;
int m_iPanel2;
Expand Down