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)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user