diff options
author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2021-06-26 14:21:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-26 14:21:18 +0200 |
commit | c8ca48823d45dadb042a80637eff954483dd5328 (patch) | |
tree | 57677ba4a33057bcc1b31d773059c414fbad06f8 /src/server/game/Maps/Map.cpp | |
parent | 6c5b641dd44a8d174d9bb8da36200e81b16f9ae8 (diff) |
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
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r-- | src/server/game/Maps/Map.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index d4e3f1cd53c..d5b64275ffd 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -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 |