From f1a2736a31db2e064db39a4ef27fc53f77cb81fa Mon Sep 17 00:00:00 2001 From: kadeshar Date: Sat, 16 May 2026 08:26:03 +0200 Subject: [PATCH] Polymorph spam fix (#2373) ## Pull Request Description Fix for polymorph spam in combat ## How to Test the Changes 1. Invite mage bot which have polymorph (check `spells polymorph`) 2. Enter combat and mage should not spam polymorph 3. Enter another combat best with multiple mobs and one of this mobs mark moon 4. Mage should cast polymorph on marked mob ## Impact Assessment - Does this change increase per-bot/per-tick processing or risk scaling poorly with thousands of bots? - - [x] No, not at all - - [ ] Minimal impact (**explain below**) - - [ ] Moderate impact (**explain below**) - Does this change modify default bot behavior? - - [x] No - - [ ] Yes (**explain why**) - Does this change add new decision branches or increase maintenance complexity? - - [x] No - - [ ] Yes (**explain below**) ## AI Assistance Was AI assistance used while working on this change? - - [x] No - - [ ] Yes (**explain below**) ## Final Checklist - - [x] Stability is not compromised. - - [x] Performance impact is understood, tested, and acceptable. - - [x] Added logic complexity is justified and explained. - - [x] Any new bot dialogue lines are translated. - - [x] Documentation updated if needed (Conf comments, WiKi commands). ## Notes for Reviewers --- src/Ai/Class/Mage/Action/MageActions.cpp | 2 -- src/Ai/Class/Mage/Action/MageActions.h | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Ai/Class/Mage/Action/MageActions.cpp b/src/Ai/Class/Mage/Action/MageActions.cpp index 5eb63ea86..63ba0d9d5 100644 --- a/src/Ai/Class/Mage/Action/MageActions.cpp +++ b/src/Ai/Class/Mage/Action/MageActions.cpp @@ -11,8 +11,6 @@ #include "ServerFacade.h" #include "SharedDefines.h" -Value* CastPolymorphAction::GetTargetValue() { return context->GetValue("cc target", getName()); } - bool UseManaSapphireAction::isUseful() { Player* bot = botAI->GetBot(); diff --git a/src/Ai/Class/Mage/Action/MageActions.h b/src/Ai/Class/Mage/Action/MageActions.h index 39d1531a7..abd302052 100644 --- a/src/Ai/Class/Mage/Action/MageActions.h +++ b/src/Ai/Class/Mage/Action/MageActions.h @@ -215,11 +215,10 @@ public: // CC, Interrupt, and Dispel Actions -class CastPolymorphAction : public CastBuffSpellAction +class CastPolymorphAction : public CastCrowdControlSpellAction { public: - CastPolymorphAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "polymorph") {} - Value* GetTargetValue() override; + CastPolymorphAction(PlayerbotAI* botAI) : CastCrowdControlSpellAction(botAI, "polymorph") {} }; class CastSpellstealAction : public CastSpellAction