diff options
author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2021-06-26 14:21:18 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-03-11 13:39:15 +0100 |
commit | 9c3dc31a3764681ae641e24ab61cd5256cc3331e (patch) | |
tree | f83455fe4ee644ea534fd5f2c795693916bb67d4 /src/server/game/Maps/Map.cpp | |
parent | 8b1be7bbfc620b2cd39a0f84b0d0300b12205255 (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
(cherry picked from commit c8ca48823d45dadb042a80637eff954483dd5328)
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 a0bc1b4cb33..de95c08b4ac 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -3399,6 +3399,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 @@ -3411,12 +3412,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(); ASSERT_NOTNULL(GetRespawnMapForType(next->type))->erase(next->spawnId); + RemoveRespawnTime(next->type, next->spawnId, nullptr, true); delete next; } else |