From 495f219a5bc7185e04267e328d3295fa5dc59f78 Mon Sep 17 00:00:00 2001 From: Peter Date: Sat, 18 Jul 2026 18:15:46 +0200 Subject: [PATCH] fix(Core/Creatures): don't spawn if the master creature is still dead (#26531) Co-authored-by: dillyns <49765217+dillyns@users.noreply.github.com> --- src/server/game/Maps/Map.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 15265050a..13b4e1bfb 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2786,6 +2786,19 @@ void Map::ProcessCreatureRespawn(ObjectGuid::LowType spawnId) } } + // Check linked_respawn: don't spawn if the master creature is still dead. + // This mirrors the check in Creature::Respawn() for compat-mode creatures. + ObjectGuid dbtableHighGuid = ObjectGuid::Create(data->id, spawnId); + time_t linkedRespawntime = GetLinkedRespawnTime(dbtableHighGuid); + if (linkedRespawntime) + { + // Master is still dead; re-queue at the master's respawn time + a small offset. + time_t now = GameTime::GetGameTime().count(); + time_t newRespawnTime = (now > linkedRespawntime ? now : linkedRespawntime) + urand(5, MINUTE); + SaveCreatureRespawnTime(spawnId, newRespawnTime); + return; + } + // Remove respawn time BEFORE LoadFromDB, otherwise the creature // reads it back and loads as DEAD instead of ALIVE RemoveCreatureRespawnTime(spawnId);