Cleanup IsTargetAlreadyReceivingSpell

This commit is contained in:
nytmyr
2024-12-20 09:50:27 -06:00
parent 665d7e3641
commit 1d0899fa0a
+9 -17
View File
@@ -9786,30 +9786,22 @@ bool Bot::IsTargetAlreadyReceivingSpell(Mob* tar, uint16 spell_id) {
m->IsBot() && m->IsBot() &&
m->IsCasting() && m->IsCasting() &&
m->CastToBot()->casting_spell_targetid && m->CastToBot()->casting_spell_targetid &&
entity_list.GetMobID(m->CastToBot()->casting_spell_targetid) == entity_list.GetMobID(tar->GetID()) &&
m->CastingSpellID() == spell_id m->CastingSpellID() == spell_id
) { ) {
return true;
}
else {
if (IsGroupSpell(spell_id)) { if (IsGroupSpell(spell_id)) {
if ( std::vector<Mob*> t = GatherSpellTargets(false, tar);
m->IsBot() &&
m->IsCasting() &&
m->CastToBot()->casting_spell_targetid &&
m->CastingSpellID() == spell_id
) {
std::vector<Mob*> x = GatherGroupSpellTargets(); for (Mob* x : t) {
if (x->GetID() == m->CastToBot()->casting_spell_targetid) {
for (Mob* t : x) { return true;
if (entity_list.GetMobID(t->CastToBot()->casting_spell_targetid) == entity_list.GetMobID(t->GetID())) {
return true;
}
} }
} }
} }
else {
if (m->CastToBot()->casting_spell_targetid == targetID) {
return true;
}
}
} }
} }