diff --git a/zone/bot.cpp b/zone/bot.cpp index a9f455a30..225f0af14 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -9783,33 +9783,25 @@ bool Bot::IsTargetAlreadyReceivingSpell(Mob* tar, uint16 spell_id) { for (Mob* m : v) { if ( - m->IsBot() && - m->IsCasting() && - m->CastToBot()->casting_spell_targetid && - entity_list.GetMobID(m->CastToBot()->casting_spell_targetid) == entity_list.GetMobID(tar->GetID()) && + m->IsBot() && + m->IsCasting() && + m->CastToBot()->casting_spell_targetid && m->CastingSpellID() == spell_id ) { - - return true; - } - else { if (IsGroupSpell(spell_id)) { - if ( - m->IsBot() && - m->IsCasting() && - m->CastToBot()->casting_spell_targetid && - m->CastingSpellID() == spell_id - ) { + std::vector t = GatherSpellTargets(false, tar); - std::vector x = GatherGroupSpellTargets(); - - for (Mob* t : x) { - if (entity_list.GetMobID(t->CastToBot()->casting_spell_targetid) == entity_list.GetMobID(t->GetID())) { - return true; - } + for (Mob* x : t) { + if (x->GetID() == m->CastToBot()->casting_spell_targetid) { + return true; } } } + else { + if (m->CastToBot()->casting_spell_targetid == targetID) { + return true; + } + } } }