diff --git a/src/game/server/neo/bot/neo_bot.cpp b/src/game/server/neo/bot/neo_bot.cpp index 791f62c2b..3045ab6e7 100644 --- a/src/game/server/neo/bot/neo_bot.cpp +++ b/src/game/server/neo/bot/neo_bot.cpp @@ -469,7 +469,7 @@ void CNEOBot::PressFireButton(float duration) { // can't fire if stunned // @todo Tom Bui: Eventually, we'll probably want to check the actual weapon for supress fire - if (HasAttribute(CNEOBot::SUPPRESS_FIRE)) + if ( GetBotPauseFiring() || HasAttribute(CNEOBot::SUPPRESS_FIRE) ) { ReleaseFireButton(); return; diff --git a/src/game/server/neo/neo_player.cpp b/src/game/server/neo/neo_player.cpp index 85437b0cf..97899ef0f 100644 --- a/src/game/server/neo/neo_player.cpp +++ b/src/game/server/neo/neo_player.cpp @@ -3253,9 +3253,16 @@ int CNEO_Player::OnTakeDamage_Alive(const CTakeDamageInfo& info) attacker->m_iTeamDamageInflicted += iDamage; } - if (info.GetDamageType() & (DMG_BULLET | DMG_SLASH | DMG_BUCKSHOT)) { + constexpr const int botDamageTypes = DMG_SLASH | DMG_BULLET | DMG_BUCKSHOT; + if (info.GetDamageType() & botDamageTypes) + { ++m_iBotDetectableBleedingInjuryEvents; } + + if (bIsTeamDmg && NEORules()->IsTeamplay() && attacker->IsBot() && (info.GetDamageType() & botDamageTypes)) + { + attacker->m_botPauseFiringTimer.Start(1.0f); + } } } } diff --git a/src/game/server/neo/neo_player.h b/src/game/server/neo/neo_player.h index ab80573be..3b82b7f88 100644 --- a/src/game/server/neo/neo_player.h +++ b/src/game/server/neo/neo_player.h @@ -178,6 +178,7 @@ class CNEO_Player : public CHL2MP_Player bool GetInThermOpticCamo() const { return m_bInThermOpticCamo; } // bots can't see anything, so they need an additional timer for cloak disruption events bool GetBotCloakStateDisrupted() const { return !m_botThermOpticCamoDisruptedTimer.IsElapsed(); } + bool GetBotPauseFiring() const { return !m_botPauseFiringTimer.IsElapsed(); } bool GetSpectatorTakeoverPlayerPending() const { return m_bSpectatorTakeoverPlayerPending; } virtual void StartAutoSprint(void) OVERRIDE; @@ -243,6 +244,8 @@ class CNEO_Player : public CHL2MP_Player // tracks time since last cloak disruption event for bots who can't actually see CountdownTimer m_botThermOpticCamoDisruptedTimer; + // cooldown after inflicting accidental team damage + CountdownTimer m_botPauseFiringTimer; private: float GetActiveWeaponSpeedScale() const;