diff options
author | Ovah <dreadkiller@gmx.de> | 2020-07-09 14:22:00 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-22 00:33:12 +0100 |
commit | 508ea9e3c7e21f363ff6ec4386cec951a6404078 (patch) | |
tree | cd0c707301673b0a87d3c5abd89c7a558421f81b /src | |
parent | 49a6394b687bdd1f4a9bb3c030d14db5ecf6b4cd (diff) |
Scripts/ICC: fixed a crash in the Lich King encounter caused by invalid corpse targets
(cherry picked from commit 232628f0a63480d07d28dcf12a7f6445ca07ab43)
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 a848a4e2ca1..e3d53c02e36 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -3188,6 +3188,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); @@ -3196,6 +3201,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); } }; |