mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/Pools: Fix pools with 1 member never spawning anything anymore (#26620)
* Core/Pools: Fix pools with 1 member never spawning anything anymore Attempts to fix a 6 years old bug and never fixed by the original author. * Remove respawn times from db once a respawn has been handled * Allow to specify if Despawn1Object() should save or not the respawn time. We don't need to do that when respawning an object. * Apply the same fix to GameObjects too
This commit is contained in:
@@ -3267,6 +3267,7 @@ void Map::ProcessRespawns()
|
||||
sPoolMgr->UpdatePool(poolId, next->type, next->spawnId);
|
||||
|
||||
// step 3: get rid of the actual entry
|
||||
RemoveRespawnTime(next->type, next->spawnId, nullptr, true);
|
||||
delete next;
|
||||
}
|
||||
else if (CheckRespawn(next)) // see if we're allowed to respawn
|
||||
@@ -3279,12 +3280,14 @@ void Map::ProcessRespawns()
|
||||
DoRespawn(next->type, next->spawnId, next->gridId);
|
||||
|
||||
// step 3: get rid of the actual entry
|
||||
RemoveRespawnTime(next->type, next->spawnId, nullptr, true);
|
||||
delete next;
|
||||
}
|
||||
else if (!next->respawnTime)
|
||||
{ // just remove this respawn entry without rescheduling
|
||||
_respawnTimes.pop();
|
||||
GetRespawnMapForType(next->type).erase(next->spawnId);
|
||||
RemoveRespawnTime(next->type, next->spawnId, nullptr, true);
|
||||
delete next;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user