diff options
| author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-06-15 14:15:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-15 14:15:22 +0200 |
| commit | 678f3dd687432b4229d903a8acfb882c2336e168 (patch) | |
| tree | 81cc84ca4b8ed6b227e2a12853223c5fdca6bd51 | |
| parent | 2315d43b2c1f478bd5f612e39f3a938bf6640ab6 (diff) | |
3.3.5 game event respawn (#23391)
* Core/GameEvent: Remove respawn times of Creature and GameObjects when starting/stopping an event
* Add checks for pool
* Remove the check for pools
| -rw-r--r-- | src/server/game/Events/GameEventMgr.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 8445ccba2ed..cefe3516a9e 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -1263,6 +1263,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) // Spawn if necessary (loaded grids only) Map* map = sMapMgr->CreateBaseMap(data->spawnPoint.GetMapId()); + map->RemoveRespawnTime(SPAWN_TYPE_CREATURE, *itr); // We use spawn coords to spawn if (!map->Instanceable() && map->IsGridLoaded(data->spawnPoint)) { @@ -1290,6 +1291,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) // Spawn if necessary (loaded grids only) // this base map checked as non-instanced and then only existed Map* map = sMapMgr->CreateBaseMap(data->spawnPoint.GetMapId()); + map->RemoveRespawnTime(SPAWN_TYPE_GAMEOBJECT, *itr); // We use current coords to unspawn, not spawn coords since creature can have changed grid if (!map->Instanceable() && map->IsGridLoaded(data->spawnPoint)) { @@ -1341,6 +1343,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) sMapMgr->DoForAllMapsWithMapId(data->spawnPoint.GetMapId(), [&itr](Map* map) { + map->RemoveRespawnTime(SPAWN_TYPE_CREATURE, *itr); auto creatureBounds = map->GetCreatureBySpawnIdStore().equal_range(*itr); for (auto itr2 = creatureBounds.first; itr2 != creatureBounds.second;) { @@ -1371,6 +1374,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) sMapMgr->DoForAllMapsWithMapId(data->spawnPoint.GetMapId(), [&itr](Map* map) { + map->RemoveRespawnTime(SPAWN_TYPE_GAMEOBJECT, *itr); auto gameobjectBounds = map->GetGameObjectBySpawnIdStore().equal_range(*itr); for (auto itr2 = gameobjectBounds.first; itr2 != gameobjectBounds.second;) { |
