Core/Spells: Don't select corpses for spell targets that expect to hit units

Closes #24980

# Conflicts:
#	src/server/game/Spells/Spell.cpp
This commit is contained in:
Shauren authored and Ovahlord committed 2020-07-09 19:14:24 +02:00
1 parent 0ce8d44288
commit 1dd44ab9b9
2 files changed
+2 -12

No files matched your search

+2 -6
View File
@@ -1894,12 +1894,8 @@ uint32 Spell::GetSearcherTypeMask(SpellTargetObjectTypes objType, ConditionConta
{
case TARGET_OBJECT_TYPE_UNIT:
case TARGET_OBJECT_TYPE_UNIT_AND_DEST:
if (!m_spellInfo->HasAttribute(SPELL_ATTR2_CAN_TARGET_DEAD))
{
retMask &= GRID_MAP_TYPE_MASK_PLAYER | GRID_MAP_TYPE_MASK_CREATURE;
break;
}
[[fallthrough]];
retMask &= GRID_MAP_TYPE_MASK_PLAYER | GRID_MAP_TYPE_MASK_CREATURE;
break;
case TARGET_OBJECT_TYPE_CORPSE:
case TARGET_OBJECT_TYPE_CORPSE_ENEMY:
case TARGET_OBJECT_TYPE_CORPSE_ALLY:
@@ -3145,11 +3145,6 @@ 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);
@@ -3158,7 +3153,6 @@ 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);
}
};