From 3055cee7aac5e144c4cd33b325cdb878cef09918 Mon Sep 17 00:00:00 2001 From: killerwife Date: Wed, 29 Nov 2023 22:35:07 +0100 Subject: [PATCH] DynGuid: Safeguard respawning of creature grouped dynguids in respawn command --- src/game/Chat/Level3.cpp | 11 +++++++---- src/game/Grids/GridNotifiers.cpp | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/game/Chat/Level3.cpp b/src/game/Chat/Level3.cpp index 77ae747c94..7cc3377863 100644 --- a/src/game/Chat/Level3.cpp +++ b/src/game/Chat/Level3.cpp @@ -5555,10 +5555,13 @@ bool ChatHandler::HandleRespawnCommand(char* /*args*/) Creature* creature = static_cast(target); if (target->IsUsingNewSpawningSystem()) { - if (creature->GetMap()->GetMapDataContainer().GetSpawnGroupByGuid(creature->GetDbGuid(), TYPEID_UNIT)) - target->GetMap()->GetPersistentState()->SaveCreatureRespawnTime(target->GetDbGuid(), time(nullptr)); - else - target->GetMap()->GetSpawnManager().RespawnCreature(target->GetDbGuid(), 0); + if (!creature->GetCreatureGroup()) + { + if (creature->GetMap()->GetMapDataContainer().GetSpawnGroupByGuid(creature->GetDbGuid(), TYPEID_UNIT)) + target->GetMap()->GetPersistentState()->SaveCreatureRespawnTime(target->GetDbGuid(), time(nullptr)); + else + target->GetMap()->GetSpawnManager().RespawnCreature(target->GetDbGuid(), 0); + } } else creature->Respawn(); diff --git a/src/game/Grids/GridNotifiers.cpp b/src/game/Grids/GridNotifiers.cpp index 4364e13ba4..74aa653162 100644 --- a/src/game/Grids/GridNotifiers.cpp +++ b/src/game/Grids/GridNotifiers.cpp @@ -235,7 +235,7 @@ void MaNGOS::RespawnDo::operator()(Creature* u) const if (u->IsUsingNewSpawningSystem()) { - if (u->IsDead()) + if (u->IsDead() && !u->GetCreatureGroup()) { if (u->GetMap()->GetMapDataContainer().GetSpawnGroupByGuid(u->GetDbGuid(), TYPEID_UNIT)) u->GetMap()->GetPersistentState()->SaveCreatureRespawnTime(u->GetDbGuid(), time(nullptr));