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 @@ -3228,9 +3228,16 @@ int CNEO_Player::OnTakeDamage_Alive(const CTakeDamageInfo& info)
32283228 attacker->m_iTeamDamageInflicted += iDamage;
32293229 }
32303230
3231- if (info.GetDamageType () & (DMG_BULLET | DMG_SLASH | DMG_BUCKSHOT)) {
3231+ constexpr const int botDamageTypes = DMG_SLASH | DMG_BULLET | DMG_BUCKSHOT;
3232+ if (info.GetDamageType () & botDamageTypes)
3233+ {
32323234 ++m_iBotDetectableBleedingInjuryEvents;
32333235 }
3236+
3237+ if (bIsTeamDmg && NEORules ()->IsTeamplay () && attacker->IsBot () && (info.GetDamageType () & botDamageTypes))
3238+ {
3239+ attacker->m_botPauseFiringTimer .Start (1 .0f );
3240+ }
32343241 }
32353242 }
32363243 }
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