From 11c9ee4d728fc5faca482679e212ace2f2ebebf6 Mon Sep 17 00:00:00 2001 From: avirar Date: Sun, 22 Dec 2024 19:48:02 +1100 Subject: [PATCH] Removed Static declarations for role assignment cooldowns --- src/strategy/raids/ulduar/RaidUlduarBossHelper.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/strategy/raids/ulduar/RaidUlduarBossHelper.h b/src/strategy/raids/ulduar/RaidUlduarBossHelper.h index 6b44b0ea..2fb84573 100644 --- a/src/strategy/raids/ulduar/RaidUlduarBossHelper.h +++ b/src/strategy/raids/ulduar/RaidUlduarBossHelper.h @@ -72,7 +72,7 @@ public: }; explicit RazorscaleBossHelper(PlayerbotAI* botAI) - : AiObject(botAI), _boss(nullptr), _lastRoleSwapTime(0), _roleSwapCooldown(10) {} + : AiObject(botAI), _boss(nullptr) {} bool UpdateBossAI(); Unit* GetBoss() const; @@ -93,8 +93,12 @@ public: private: Unit* _boss; - std::time_t _lastRoleSwapTime; - const std::time_t _roleSwapCooldown; + + // A map to track the last role swap *per bot* by their GUID + static std::unordered_map _lastRoleSwapTime; + + // The cooldown that applies to every bot + static const std::time_t _roleSwapCooldown = 10; static std::unordered_map _harpoonCooldowns; };