Files
ForeverCore/tests/game/CorpseTargetExplicitMask.cpp
Karrz1 8b4422e490 Spells: Revive no longer crashes the server
A spell whose target type is "an ally's corpse" (TARGET_CORPSE_TARGET_ALLY)
asked for no explicit target unless its SpellTargetRestrictions row said so.
Druid Revive (437138, and 1237948-1237951) and Reintegration (430318) have no
such row, so the server dropped the dead player as the target, and when the
cast finished it hit the assert in SelectImplicitTargetObjectTargets: the
world server went down on every Revive (report and crash dump from the
#bug-reports thread, 2026-11-12). The target type itself now asks for an
ally corpse or an unreleased dead player, as the other resurrections do.

New test CorpseTargetExplicitMask (new file: cmake reconfigure needed).

(cherry picked from commit 5486906812844dfe48c2967692ee954573008dea)
2026-11-13 02:23:30 +00:00

23 lines
1.1 KiB
C++

#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);
}