Move npc_metropolice enemy kill concept to Event_KilledOther()

This commit is contained in:
ALLEN-PC\acj30 2025-01-09 12:29:03 -06:00 committed by Blixibon
parent 10f08829e5
commit b055d77663
2 changed files with 19 additions and 0 deletions

View File

@ -534,10 +534,12 @@ void CNPC_MetroPolice::OnScheduleChange()
{
BaseClass::OnScheduleChange();
#ifndef MAPBASE // Moved to Event_KilledOther()
if ( GetEnemy() && HasCondition( COND_ENEMY_DEAD ) )
{
AnnounceEnemyKill( GetEnemy() );
}
#endif
}
@ -3722,6 +3724,21 @@ void CNPC_MetroPolice::Event_Killed( const CTakeDamageInfo &info )
BaseClass::Event_Killed( info );
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void CNPC_MetroPolice::Event_KilledOther( CBaseEntity *pVictim, const CTakeDamageInfo &info )
{
BaseClass::Event_KilledOther( pVictim, info );
#ifdef MAPBASE // Moved from OnScheduleChange()
if ( pVictim && (pVictim->IsPlayer() || pVictim->IsNPC()) )
{
AnnounceEnemyKill( pVictim );
}
#endif
}
//-----------------------------------------------------------------------------
// Try to enter a slot where we shoot a pistol
//-----------------------------------------------------------------------------

View File

@ -79,6 +79,8 @@ public:
virtual void Event_Killed( const CTakeDamageInfo &info );
virtual void Event_KilledOther( CBaseEntity *pVictim, const CTakeDamageInfo &info );
virtual void OnScheduleChange();
float GetIdealAccel( void ) const;