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
# Conflicts:
#	src/server/game/Pools/PoolMgr.h
This commit is contained in:
Giacomo Pozzoni authored and Ovahlord committed 2021-06-27 06:33:19 +02:00
1 parent b64983d753
commit d83cd33bd4
4 files changed
+26 -18

No files matched your search

+3
View File
@@ -3226,6 +3226,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
@@ -3238,12 +3239,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