Core/Maps: Removed MapInstanced - no longer neccessary for grid data reference counting (moved to TerrainInfo)

Port From (https://github.com/TrinityCore/TrinityCore/commit/fbe0b8efebca3bc2662b477bdf45627f9783d6c2)
This commit is contained in:
hondacrx
2022-07-24 17:50:51 -04:00
parent 3cd58e4a17
commit efd2f4cb49
13 changed files with 513 additions and 734 deletions
@@ -109,7 +109,7 @@ namespace Game.Movement
break;
if (_currentNode == _preloadTargetNode)
PreloadEndGrid();
PreloadEndGrid(owner);
_currentNode += (departureEvent ? 1 : 0);
departureEvent = !departureEvent;
@@ -262,14 +262,17 @@ namespace Game.Movement
else
_preloadTargetNode = (uint)nodeCount - 3;
while (_path[(int)_preloadTargetNode].ContinentID != _endMapId)
++_preloadTargetNode;
_endGridX = _path[nodeCount - 1].Loc.X;
_endGridY = _path[nodeCount - 1].Loc.Y;
}
void PreloadEndGrid()
void PreloadEndGrid(Player owner)
{
// Used to preload the final grid where the flightmaster is
Map endMap = Global.MapMgr.FindBaseNonInstanceMap(_endMapId);
Map endMap = owner.GetMap();
// Load the grid
if (endMap != null)