Scripts/Deadmines: added some safety checks for some spellscripts in all boss scripts

This commit is contained in:
Ovahlord committed 2018-05-30 11:48:30 +02:00
1 parent 473c663e3b
commit 7184862351
5 files changed
+12 -6

No files matched your search

@@ -393,7 +393,8 @@ class spell_ripsnarl_go_for_the_throat_targeting : public SpellScriptLoader
void HandleHit(SpellEffIndex effIndex)
{
GetCaster()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
if (Unit* caster = GetCaster())
caster->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
}
void Register() override
@@ -293,7 +293,8 @@ class spell_cookie_throw_food_targeting : public SpellScriptLoader
void HandleHit(SpellEffIndex effIndex)
{
GetCaster()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints);
if (Unit* caster = GetCaster())
caster->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints);
}
void Register() override
@@ -469,7 +469,8 @@ class spell_foe_reaper_5000_acquire_target : public SpellScriptLoader
void HandleHit(SpellEffIndex effIndex)
{
GetCaster()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints);
if (Unit* caster = GetCaster())
caster->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints);
}
void Register() override
@@ -524,7 +525,8 @@ class spell_foe_reaper_5000_fixate_targeting : public SpellScriptLoader
void HandleHit(SpellEffIndex effIndex)
{
GetCaster()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
if (Unit* caster = GetCaster())
caster->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
}
void Register() override
@@ -660,7 +660,8 @@ class spell_helix_oaf_grab_targeting : public SpellScriptLoader
void HandleHit(SpellEffIndex effIndex)
{
GetCaster()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
if (Unit* caster = GetCaster())
caster->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
}
void Register() override
@@ -710,7 +710,8 @@ class spell_vanessa_backslash_targeting : public SpellScriptLoader
void HandleHit(SpellEffIndex effIndex)
{
GetCaster()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
if (Unit* caster = GetCaster())
caster->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
}
void FilterTargets(std::list<WorldObject*>& targets)