1
0

rely on remaining targets to delete the spell, caster ptr is not reliable in this case

This commit is contained in:
Emagi 2024-12-01 17:55:42 -05:00
parent 5770adffee
commit 9e986f3ace

View File

@ -1614,11 +1614,7 @@ void LuaInterface::DeletePendingSpells(bool all) {
spell = *del_itr; spell = *del_itr;
if(!all) { if(!all) {
if (spell->caster) { // rely on targets the spell->caster could be corrupt
ZoneServer* curZone = spell->caster->GetZone();
if(curZone)
curZone->GetSpellProcess()->DeleteActiveSpell(spell, true);
}
if(spell->targets.size() > 0) { if(spell->targets.size() > 0) {
spell->MSpellTargets.readlock(__FUNCTION__, __LINE__); spell->MSpellTargets.readlock(__FUNCTION__, __LINE__);
for (int8 i = 0; i < spell->targets.size(); i++) { for (int8 i = 0; i < spell->targets.size(); i++) {