From a5c0091588211c8307d0449110b3dfb0f6587ba9 Mon Sep 17 00:00:00 2001 From: Blixibon Date: Mon, 18 Oct 2021 11:37:06 -0500 Subject: [PATCH] Fixed metrocop unholster behavior --- sp/src/game/server/hl2/npc_metropolice.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sp/src/game/server/hl2/npc_metropolice.cpp b/sp/src/game/server/hl2/npc_metropolice.cpp index 31e86f37..9d8e0b96 100644 --- a/sp/src/game/server/hl2/npc_metropolice.cpp +++ b/sp/src/game/server/hl2/npc_metropolice.cpp @@ -1537,7 +1537,12 @@ void CNPC_MetroPolice::OnUpdateShotRegulator( ) BaseClass::OnUpdateShotRegulator(); // FIXME: This code (except the burst interval) could be used for all weapon types +#ifdef MAPBASE + // Only if we actually have the pistol out + if ( EntIsClass( GetActiveWeapon(), gm_isz_class_Pistol ) ) +#else if( Weapon_OwnsThisType( "weapon_pistol" ) ) +#endif { if ( m_nBurstMode == BURST_NOT_ACTIVE ) { @@ -3900,9 +3905,9 @@ int CNPC_MetroPolice::SelectScheduleNoDirectEnemy() } #ifdef MAPBASE - // If you see your enemy and your weapon is holstered, you're probably about to arm yourself. - // Wait and don't just charge in - if ( IsWeaponHolstered() && HasCondition(COND_SEE_ENEMY) ) + // If you see your enemy and you're still arming yourself, wait and don't just charge in + // (if your weapon is holstered, you're probably about to arm yourself) + if ( HasCondition( COND_SEE_ENEMY ) && (IsWeaponHolstered() || FindGestureLayer( TranslateActivity( ACT_ARM ) )) ) { return SCHED_COMBAT_FACE; }