Fix some memory leaks in Mob::SpellOnTarget

This should fix the memory leak introduced in the last commit and
a few lingering memory leaks, don't think they should break anything
This commit is contained in:
Michael Cook
2013-10-24 17:35:21 -04:00
parent a06fe1d02e
commit 36d336e69c
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -3287,6 +3287,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
spelltar->GetBodyType() != BT_Undead &&
spelltar->GetBodyType() != BT_Vampire)
{
safe_delete(action_packet);
return false;
}
}
@@ -3300,6 +3301,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
if(focus) {
CheckHitsRemaining(b);
Message_StringID(MT_Shout, SPELL_WOULDNT_HOLD);
safe_delete(action_packet);
return false;
}
}
@@ -3347,6 +3349,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
if(reflect_chance) {
Message_StringID(MT_Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName());
SpellOnTarget(spell_id, this, true, use_resist_adjust, resist_adjust);
safe_delete(action_packet);
return false;
}
}
@@ -3520,6 +3523,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
mlog(SPELLS__BUFFS, "Spell %d failed: recipient did not meet the level restrictions", spell_id);
if(!IsBardSong(spell_id))
Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL);
safe_delete(action_packet);
return false;
}