diff options
| author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2020-04-11 12:07:57 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-11 14:07:57 +0200 |
| commit | 4f33fd3932d362466ee017111895bf14fcc79c88 (patch) | |
| tree | a446a043eaa8d5b6c84ce0389be85c9e09e85d88 /src/server/game/Maps/Map.h | |
| parent | eb31ae9b1839ff26246d68584937825bd7ce7932 (diff) | |
Core/Pooling: Remove respawn times from the database when despawning a pool (#24422)
* Core/Pooling: Remove respawn times from the database when despawning a pool
Remove respawn times from the database when despawning a pool. This is needed when a Game Event ends but there are still some respawn times saved in the database.
* Remove respawn time of active pool objects even if they are not spawned
Diffstat (limited to 'src/server/game/Maps/Map.h')
| -rw-r--r-- | src/server/game/Maps/Map.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 7b8812d6304..fca66292cb4 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -771,6 +771,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType> bool AddRespawnInfo(RespawnInfo const& info); void UnloadAllRespawnInfos(); void DeleteRespawnInfo(RespawnInfo* info, CharacterDatabaseTransaction dbTrans = nullptr); + void DeleteRespawnInfoFromDB(SpawnObjectType type, ObjectGuid::LowType spawnId, CharacterDatabaseTransaction dbTrans = nullptr); public: void GetRespawnInfo(std::vector<RespawnInfo*>& respawnData, SpawnObjectTypeMask types) const; @@ -781,10 +782,13 @@ class TC_GAME_API Map : public GridRefManager<NGridType> Respawn(info, dbTrans); } void Respawn(RespawnInfo* info, CharacterDatabaseTransaction dbTrans = nullptr); - void RemoveRespawnTime(SpawnObjectType type, ObjectGuid::LowType spawnId, CharacterDatabaseTransaction dbTrans = nullptr) + void RemoveRespawnTime(SpawnObjectType type, ObjectGuid::LowType spawnId, CharacterDatabaseTransaction dbTrans = nullptr, bool alwaysDeleteFromDB = false) { if (RespawnInfo* info = GetRespawnInfo(type, spawnId)) DeleteRespawnInfo(info, dbTrans); + // Some callers might need to make sure the database doesn't contain any respawn time + else if (alwaysDeleteFromDB) + DeleteRespawnInfoFromDB(type, spawnId, dbTrans); } size_t DespawnAll(SpawnObjectType type, ObjectGuid::LowType spawnId); |
