fix(Core/Combat): drop dangling current victim on phase change crash (#26020)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-05-29 09:22:01 -05:00
committed by GitHub
parent c029eab828
commit 46f0d4033a
2 changed files with 5 additions and 21 deletions
@@ -734,7 +734,7 @@ TEST_F(ThreatManagerIntegrationTest,
}
// ============================================================================
// Phase Change + Threat Offline State Tests (SetPhaseMask order fix)
// Phase Change + Threat Offline State Tests
// ============================================================================
TEST_F(ThreatManagerIntegrationTest,
@@ -748,6 +748,10 @@ TEST_F(ThreatManagerIntegrationTest,
// Move B to a different phase
_creatureB->SetPhase(2);
// Online state is refreshed lazily on the next threat update tick (matches
// TrinityCore - SetPhaseMask itself does not touch threat)
_creatureA->TestGetThreatMgr().Update(ThreatManager::THREAT_UPDATE_INTERVAL);
// B should now be offline on A's threat list (different phases)
// The list is not empty if we include offline, but empty if we don't
EXPECT_TRUE(_creatureA->TestGetThreatMgr().IsThreatenedBy(_creatureB, true)); // includeOffline