From 60b65da7f2d1f48f57fe42053377c430c07a46b1 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Wed, 22 Nov 2023 21:44:59 -0600 Subject: [PATCH] [Bug Fix] Fix some spell types failing IsValidSpellRange check (#3707) Hate Reduction, Slow and DoT spells were failing IsValidSpellRange checks due to improper spell IDs being checked. They were using the first spell in a bot's spell list by checking botSpell.id vs the proper spells in the loop. --- zone/botspellsai.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 17fbe4321..fa93bd955 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -183,7 +183,7 @@ bool Bot::BotCastHateReduction(Mob* tar, uint8 botLevel, const BotSpell& botSpel if (tar->CanBuffStack(iter.SpellId, botLevel, true) < 0) continue; - if (IsValidSpellRange(botSpell.SpellId, tar)) { + if (IsValidSpellRange(iter.SpellId, tar)) { casted_spell = AIDoSpellCast(iter.SpellIndex, tar, iter.ManaCost); } if (casted_spell) { @@ -328,7 +328,7 @@ bool Bot::BotCastSlow(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe continue; } - if (IsValidSpellRange(botSpell.SpellId, tar)) { + if (IsValidSpellRange(iter.SpellId, tar)) { casted_spell = AIDoSpellCast(iter.SpellIndex, tar, iter.ManaCost); } @@ -447,7 +447,7 @@ bool Bot::BotCastDOT(Mob* tar, uint8 botLevel, const BotSpell& botSpell, const b uint32 TempDontDotMeBefore = tar->DontDotMeBefore(); - if (IsValidSpellRange(botSpell.SpellId, tar)) { + if (IsValidSpellRange(s.SpellId, tar)) { casted_spell = AIDoSpellCast(s.SpellIndex, tar, s.ManaCost, &TempDontDotMeBefore); }