diff options
author | Ovah <dreadkiller@gmx.de> | 2020-07-09 14:22:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 14:22:00 +0200 |
commit | 232628f0a63480d07d28dcf12a7f6445ca07ab43 (patch) | |
tree | e4f7703d657698e0078ee00f0099efb0033e4371 /src | |
parent | c1eb1c41f8b28793cbf4fb49b29f0106d8666c03 (diff) |
Scripts/ICC: fixed a crash in the Lich King encounter caused by invalid corpse targets
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<WorldObject*>& 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); } }; |