From 232628f0a63480d07d28dcf12a7f6445ca07ab43 Mon Sep 17 00:00:00 2001 From: Ovah Date: Thu, 9 Jul 2020 14:22:00 +0200 Subject: Scripts/ICC: fixed a crash in the Lich King encounter caused by invalid corpse targets --- src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 4d27facd77b..290710745fb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -3205,6 +3205,11 @@ class spell_the_lich_king_jump_remove_aura : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_jump_SpellScript); + void FilterTargets(std::list& targets) + { + targets.remove_if([](WorldObject const* target) { return target->IsCorpse(); }); + } + void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); @@ -3213,6 +3218,7 @@ class spell_the_lich_king_jump_remove_aura : public SpellScriptLoader void Register() override { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_jump_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); OnEffectHitTarget += SpellEffectFn(spell_the_lich_king_jump_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; -- cgit v1.2.3