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

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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)