File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -469,7 +469,7 @@ void CNEOBot::PressFireButton(float duration)
469469{
470470 // can't fire if stunned
471471 // @todo Tom Bui: Eventually, we'll probably want to check the actual weapon for supress fire
472- if (HasAttribute (CNEOBot::SUPPRESS_FIRE))
472+ if ( GetBotPauseFiring () || HasAttribute (CNEOBot::SUPPRESS_FIRE) )
473473 {
474474 ReleaseFireButton ();
475475 return ;
Original file line number Diff line number Diff line change @@ -3253,9 +3253,16 @@ int CNEO_Player::OnTakeDamage_Alive(const CTakeDamageInfo& info)
32533253 attacker->m_iTeamDamageInflicted += iDamage;
32543254 }
32553255
3256- if (info.GetDamageType () & (DMG_BULLET | DMG_SLASH | DMG_BUCKSHOT)) {
3256+ constexpr const int botDamageTypes = DMG_SLASH | DMG_BULLET | DMG_BUCKSHOT;
3257+ if (info.GetDamageType () & botDamageTypes)
3258+ {
32573259 ++m_iBotDetectableBleedingInjuryEvents;
32583260 }
3261+
3262+ if (bIsTeamDmg && NEORules ()->IsTeamplay () && attacker->IsBot () && (info.GetDamageType () & botDamageTypes))
3263+ {
3264+ attacker->m_botPauseFiringTimer .Start (1 .0f );
3265+ }
32593266 }
32603267 }
32613268 }
Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ class CNEO_Player : public CHL2MP_Player
178178 bool GetInThermOpticCamo () const { return m_bInThermOpticCamo; }
179179 // bots can't see anything, so they need an additional timer for cloak disruption events
180180 bool GetBotCloakStateDisrupted () const { return !m_botThermOpticCamoDisruptedTimer.IsElapsed (); }
181+ bool GetBotPauseFiring () const { return !m_botPauseFiringTimer.IsElapsed (); }
181182 bool GetSpectatorTakeoverPlayerPending () const { return m_bSpectatorTakeoverPlayerPending; }
182183
183184 virtual void StartAutoSprint (void ) OVERRIDE;
@@ -243,6 +244,8 @@ class CNEO_Player : public CHL2MP_Player
243244
244245 // tracks time since last cloak disruption event for bots who can't actually see
245246 CountdownTimer m_botThermOpticCamoDisruptedTimer;
247+ // cooldown after inflicting accidental team damage
248+ CountdownTimer m_botPauseFiringTimer;
246249
247250private:
248251 float GetActiveWeaponSpeedScale () const ;
You can’t perform that action at this time.
0 commit comments