diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index d8b704186c..92518f387d 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -198,6 +198,33 @@ uint32 SpellImplicitTargetInfo::GetExplicitTargetMask(bool& srcSet, bool& dstSet break; } break; + // The explicit target is a corpse (or a player who has not released yet). Resurrection spells carry + // TARGET_FLAG_CORPSE_ALLY in SpellTargetRestrictions::Targets too, but not all of them: Classic 1.60 + // Revive (437138) has no row there. Without this its explicit mask was empty, so InitExplicitTargets + // dropped the dead player as a target and the finished cast hit the ASSERT in + // SelectImplicitTargetObjectTargets (player report 2026-11-12). + case TARGET_OBJECT_TYPE_CORPSE_ALLY: + targetMask = TARGET_FLAG_CORPSE_ALLY; + break; + case TARGET_OBJECT_TYPE_CORPSE_ENEMY: + targetMask = TARGET_FLAG_CORPSE_ENEMY; + break; + case TARGET_OBJECT_TYPE_CORPSE: + switch (GetCheckType()) + { + case TARGET_CHECK_ENEMY: + targetMask = TARGET_FLAG_CORPSE_ENEMY; + break; + case TARGET_CHECK_ALLY: + case TARGET_CHECK_PARTY: + case TARGET_CHECK_RAID: + targetMask = TARGET_FLAG_CORPSE_ALLY; + break; + default: + targetMask = TARGET_FLAG_CORPSE_ALLY | TARGET_FLAG_CORPSE_ENEMY; + break; + } + break; default: break; } diff --git a/tests/game/CorpseTargetExplicitMask.cpp b/tests/game/CorpseTargetExplicitMask.cpp new file mode 100644 index 0000000000..0af81b84ce --- /dev/null +++ b/tests/game/CorpseTargetExplicitMask.cpp @@ -0,0 +1,22 @@ +#include "tc_catch2.h" +#include "SpellInfo.h" + +// Classic 1.60 Revive (437138, also 1237948-1237951) and Reintegration (430318) resurrect through TARGET_CORPSE_TARGET_ALLY and, +// unlike the other resurrection spells, have no SpellTargetRestrictions row carrying TARGET_FLAG_CORPSE_ALLY. The target type alone +// must ask for a corpse (or an unreleased dead player): with an empty explicit mask the cast dropped its target and the finished cast +// hit the ASSERT in Spell::SelectImplicitTargetObjectTargets (player report 2026-11-12, worldserver crash on every Revive). +TEST_CASE("TARGET_CORPSE_TARGET_ALLY asks for an explicit ally corpse", "[CorpseTargetExplicitMask]") +{ + bool srcSet = false; + bool dstSet = false; + CHECK(SpellImplicitTargetInfo(TARGET_CORPSE_TARGET_ALLY).GetExplicitTargetMask(srcSet, dstSet) == TARGET_FLAG_CORPSE_ALLY); + CHECK_FALSE(srcSet); + CHECK_FALSE(dstSet); +} + +TEST_CASE("A corpse area around the caster still needs no explicit target", "[CorpseTargetExplicitMask]") +{ + bool srcSet = false; + bool dstSet = false; + CHECK(SpellImplicitTargetInfo(TARGET_CORPSE_SRC_AREA_RAID).GetExplicitTargetMask(srcSet, dstSet) == 0); +}