fix(Core/Maps): fix pooled creature/GO respawn in instanced maps (#25826)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2717,13 +2717,19 @@ void Map::ProcessRespawns()
|
|||||||
|
|
||||||
void Map::ProcessCreatureRespawn(ObjectGuid::LowType spawnId)
|
void Map::ProcessCreatureRespawn(ObjectGuid::LowType spawnId)
|
||||||
{
|
{
|
||||||
// Pool members are handled entirely by PoolMgr
|
// Pool members in non-instanced maps are handled entirely by PoolMgr.
|
||||||
|
// In instanced maps the pool system operates globally and Spawn1Object is
|
||||||
|
// a no-op for instanceable maps, so fall through to the normal per-instance
|
||||||
|
// respawn logic instead.
|
||||||
|
if (!Instanceable())
|
||||||
|
{
|
||||||
if (uint32 poolId = sPoolMgr->IsPartOfAPool<Creature>(spawnId))
|
if (uint32 poolId = sPoolMgr->IsPartOfAPool<Creature>(spawnId))
|
||||||
{
|
{
|
||||||
sPoolMgr->UpdatePool<Creature>(poolId, spawnId);
|
sPoolMgr->UpdatePool<Creature>(poolId, spawnId);
|
||||||
RemoveCreatureRespawnTime(spawnId);
|
RemoveCreatureRespawnTime(spawnId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CreatureData const* data = sObjectMgr->GetCreatureData(spawnId);
|
CreatureData const* data = sObjectMgr->GetCreatureData(spawnId);
|
||||||
if (!data)
|
if (!data)
|
||||||
@@ -2778,13 +2784,17 @@ void Map::ProcessCreatureRespawn(ObjectGuid::LowType spawnId)
|
|||||||
|
|
||||||
void Map::ProcessGameObjectRespawn(ObjectGuid::LowType spawnId)
|
void Map::ProcessGameObjectRespawn(ObjectGuid::LowType spawnId)
|
||||||
{
|
{
|
||||||
// Pool members are handled entirely by PoolMgr
|
// Same rationale as ProcessCreatureRespawn: pool management via PoolMgr is
|
||||||
|
// only meaningful for non-instanced maps where Spawn1Object actually spawns.
|
||||||
|
if (!Instanceable())
|
||||||
|
{
|
||||||
if (uint32 poolId = sPoolMgr->IsPartOfAPool<GameObject>(spawnId))
|
if (uint32 poolId = sPoolMgr->IsPartOfAPool<GameObject>(spawnId))
|
||||||
{
|
{
|
||||||
sPoolMgr->UpdatePool<GameObject>(poolId, spawnId);
|
sPoolMgr->UpdatePool<GameObject>(poolId, spawnId);
|
||||||
RemoveGORespawnTime(spawnId);
|
RemoveGORespawnTime(spawnId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GameObjectData const* data = sObjectMgr->GetGameObjectData(spawnId);
|
GameObjectData const* data = sObjectMgr->GetGameObjectData(spawnId);
|
||||||
if (!data)
|
if (!data)
|
||||||
|
|||||||
Reference in New Issue
Block a user