aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2019-06-15 14:15:22 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-11 13:06:13 +0100
commit4e7727d575f2c22dddc6327d89e0cfecb9b9748e (patch)
tree0044a7323560161636fef5c86f7bc5d5912c4587
parent6b7bc82641e0cb7cf8add1089d8dde0aad93edbe (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 (cherry picked from commit 678f3dd687432b4229d903a8acfb882c2336e168)
-rw-r--r--src/server/game/Events/GameEventMgr.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index 8977521159d..aa56c361f00 100644
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -1233,7 +1233,8 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
sObjectMgr->AddCreatureToGrid(*itr, data);
// Spawn if necessary (loaded grids only)
- Map* map = sMapMgr->FindMap(data->spawnPoint.GetMapId(), 0);
+ Map* map = sMapMgr->CreateBaseMap(data->spawnPoint.GetMapId());
+ map->RemoveRespawnTime(SPAWN_TYPE_CREATURE, *itr);
// We use spawn coords to spawn
if (map && !map->Instanceable() && map->IsGridLoaded(data->spawnPoint))
Creature::CreateCreatureFromDB(*itr, map);
@@ -1255,7 +1256,8 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
sObjectMgr->AddGameobjectToGrid(*itr, data);
// Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existed
- Map* map = sMapMgr->FindMap(data->spawnPoint.GetMapId(), 0);
+ 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 && !map->Instanceable() && map->IsGridLoaded(data->spawnPoint))
{
@@ -1306,6 +1308,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;)
{
@@ -1336,6 +1339,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;)
{