diff --git a/playerbot/strategy/generic/NonCombatStrategy.cpp b/playerbot/strategy/generic/NonCombatStrategy.cpp index 9801e4e2..ee54f2ed 100644 --- a/playerbot/strategy/generic/NonCombatStrategy.cpp +++ b/playerbot/strategy/generic/NonCombatStrategy.cpp @@ -62,3 +62,19 @@ void WorldBuffStrategy::InitNonCombatTriggers(std::list& triggers) "need world buff", NextAction::array(0, new NextAction("world buff", 1.0f), NULL))); } + +void WorldBuffStrategy::OnStrategyRemoved(BotState state) +{ + // Remove world buffs + Player* bot = ai->GetBot(); + if (bot) + { + for (auto& wb : sPlayerbotAIConfig.worldBuffs) + { + if (bot->HasAura(wb.spellId)) + { + bot->RemoveAurasDueToSpell(wb.spellId); + } + } + } +} diff --git a/playerbot/strategy/generic/NonCombatStrategy.h b/playerbot/strategy/generic/NonCombatStrategy.h index ef1c0760..05658fac 100644 --- a/playerbot/strategy/generic/NonCombatStrategy.h +++ b/playerbot/strategy/generic/NonCombatStrategy.h @@ -53,5 +53,6 @@ namespace ai protected: virtual void InitNonCombatTriggers(std::list& triggers) override; + void OnStrategyRemoved(BotState state) override; }; }