From 1e67bd4dd79678acbeaf9b434651e804a38b9cf8 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 19 Jun 2019 15:30:41 -0400 Subject: [PATCH] Core/Maps: Ensure all child terrain maps are created before doing anything on parent map such as loading respawn times and corpses Port TrinityCore Commit: https://github.com/TrinityCore/TrinityCore/commit/f7290509005d3b93bb62149faf3add0bb7f54f51 --- Source/Game/Maps/MapManager.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Game/Maps/MapManager.cs b/Source/Game/Maps/MapManager.cs index 12cfc0049..82e778578 100644 --- a/Source/Game/Maps/MapManager.cs +++ b/Source/Game/Maps/MapManager.cs @@ -82,17 +82,19 @@ namespace Game.Entities if (mapEntry.Instanceable()) map = new MapInstanced(mapEntry.Id, i_gridCleanUpDelay); else - { map = new Map(mapEntry.Id, i_gridCleanUpDelay, 0, Difficulty.None); - map.LoadRespawnTimes(); - map.LoadCorpseData(); - } i_maps[mapEntry.Id] = map; foreach (uint childMapId in _parentMapData[mapEntry.Id]) map.AddChildTerrainMap(CreateBaseMap_i(CliDB.MapStorage.LookupByKey(childMapId))); + if (!mapEntry.Instanceable()) + { + map.LoadRespawnTimes(); + map.LoadCorpseData(); + } + return map; }