File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
Expand file tree Collapse file tree 3 files changed +12
-2
lines changed 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 @@ -3273,9 +3273,16 @@ int CNEO_Player::OnTakeDamage_Alive(const CTakeDamageInfo& info)
32733273 attacker->m_iTeamDamageInflicted += iDamage;
32743274 }
32753275
3276- if (info.GetDamageType () & (DMG_BULLET | DMG_SLASH | DMG_BUCKSHOT)) {
3276+ constexpr const int botDamageTypes = DMG_SLASH | DMG_BULLET | DMG_BUCKSHOT;
3277+ if (info.GetDamageType () & botDamageTypes)
3278+ {
32773279 ++m_iBotDetectableBleedingInjuryEvents;
32783280 }
3281+
3282+ if (bIsTeamDmg && NEORules ()->IsTeamplay () && attacker->IsBot () && (info.GetDamageType () & botDamageTypes))
3283+ {
3284+ attacker->m_botPauseFiringTimer .Start (1 .0f );
3285+ }
32793286 }
32803287 }
32813288 }
Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ class CNEO_Player : public CHL2MP_Player
180180 bool GetInThermOpticCamo () const { return m_bInThermOpticCamo; }
181181 // bots can't see anything, so they need an additional timer for cloak disruption events
182182 bool GetBotCloakStateDisrupted () const { return !m_botThermOpticCamoDisruptedTimer.IsElapsed (); }
183+ bool GetBotPauseFiring () const { return !m_botPauseFiringTimer.IsElapsed (); }
183184 bool GetSpectatorTakeoverPlayerPending () const { return m_bSpectatorTakeoverPlayerPending; }
184185
185186 virtual void StartAutoSprint (void ) OVERRIDE;
@@ -245,6 +246,8 @@ class CNEO_Player : public CHL2MP_Player
245246
246247 // tracks time since last cloak disruption event for bots who can't actually see
247248 CountdownTimer m_botThermOpticCamoDisruptedTimer;
249+ // cooldown after inflicting accidental team damage
250+ CountdownTimer m_botPauseFiringTimer;
248251
249252private:
250253 float GetActiveWeaponSpeedScale () const ;
You can’t perform that action at this time.
0 commit comments