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
+9 -9
View File
@@ -205,8 +205,8 @@ namespace Game.Chat.Commands
else
player.SaveRecallPosition(); // save only in non-flight case
Map map = Global.MapMgr.CreateBaseMap(mapId);
float z = Math.Max(map.GetStaticHeight(PhasingHandler.EmptyPhaseShift, x, y, MapConst.MaxHeight), map.GetWaterLevel(PhasingHandler.EmptyPhaseShift, x, y));
TerrainInfo terrain = Global.TerrainMgr.LoadTerrain(mapId);
float z = Math.Max(terrain.GetStaticHeight(PhasingHandler.EmptyPhaseShift, x, y, MapConst.MaxHeight), terrain.GetWaterLevel(PhasingHandler.EmptyPhaseShift, x, y));
player.TeleportTo(mapId, x, y, z, player.GetOrientation());
return true;
@@ -352,8 +352,8 @@ namespace Game.Chat.Commands
else
player.SaveRecallPosition(); // save only in non-flight case
Map map = Global.MapMgr.CreateBaseMap(mapId);
z = Math.Max(map.GetStaticHeight(PhasingHandler.EmptyPhaseShift, x, y, MapConst.MaxHeight), map.GetWaterLevel(PhasingHandler.EmptyPhaseShift, x, y));
TerrainInfo terrain = Global.TerrainMgr.LoadTerrain(mapId);
z = Math.Max(terrain.GetStaticHeight(PhasingHandler.EmptyPhaseShift, x, y, MapConst.MaxHeight), terrain.GetWaterLevel(PhasingHandler.EmptyPhaseShift, x, y));
player.TeleportTo(mapId, x, y, z, 0.0f);
return true;
@@ -398,8 +398,8 @@ namespace Game.Chat.Commands
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, x, y, mapId);
return false;
}
Map map = Global.MapMgr.CreateBaseMap(mapId);
z = Math.Max(map.GetStaticHeight(PhasingHandler.EmptyPhaseShift, x, y, MapConst.MaxHeight), map.GetWaterLevel(PhasingHandler.EmptyPhaseShift, x, y));
TerrainInfo terrain = Global.TerrainMgr.LoadTerrain(mapId);
z = Math.Max(terrain.GetStaticHeight(PhasingHandler.EmptyPhaseShift, x, y, MapConst.MaxHeight), terrain.GetWaterLevel(PhasingHandler.EmptyPhaseShift, x, y));
}
return DoTeleport(handler, new Position(x, y, z.Value, o.Value), mapId);
@@ -427,10 +427,10 @@ namespace Game.Chat.Commands
x /= 100.0f;
y /= 100.0f;
Map map = Global.MapMgr.CreateBaseMap(zoneEntry.ContinentID);
TerrainInfo terrain = Global.TerrainMgr.LoadTerrain(zoneEntry.ContinentID);
if (!Global.DB2Mgr.Zone2MapCoordinates(areaEntry.ParentAreaID != 0 ? areaEntry.ParentAreaID : areaId, ref x, ref y))
{
handler.SendSysMessage(CypherStrings.InvalidZoneMap, areaId, areaEntry.AreaName[handler.GetSessionDbcLocale()], map.GetId(), map.GetMapName());
handler.SendSysMessage(CypherStrings.InvalidZoneMap, areaId, areaEntry.AreaName[handler.GetSessionDbcLocale()], terrain.GetId(), terrain.GetMapName());
return false;
}
@@ -446,7 +446,7 @@ namespace Game.Chat.Commands
else
player.SaveRecallPosition(); // save only in non-flight case
float z = Math.Max(map.GetStaticHeight(PhasingHandler.EmptyPhaseShift, x, y, MapConst.MaxHeight), map.GetWaterLevel(PhasingHandler.EmptyPhaseShift, x, y));
float z = Math.Max(terrain.GetStaticHeight(PhasingHandler.EmptyPhaseShift, x, y, MapConst.MaxHeight), terrain.GetWaterLevel(PhasingHandler.EmptyPhaseShift, x, y));
player.TeleportTo(zoneEntry.ContinentID, x, y, z, player.GetOrientation());
return true;