Core/Maps: Fixed retrieving terrain info when on child maps

Port From (https://github.com/TrinityCore/TrinityCore/commit/704142f15a51055c4fa064b1286b65d78b795e05)
This commit is contained in:
hondacrx
2023-01-06 16:38:58 -05:00
parent a16289d51e
commit 54a507e284
9 changed files with 77 additions and 74 deletions
+3 -3
View File
@@ -564,10 +564,10 @@ namespace Game
return obj.GetPhaseShift().CanSee(phaseShift);
}
public static uint GetTerrainMapId(PhaseShift phaseShift, TerrainInfo terrain, float x, float y)
public static uint GetTerrainMapId(PhaseShift phaseShift, uint mapId, TerrainInfo terrain, float x, float y)
{
if (phaseShift.VisibleMapIds.Empty())
return terrain.GetId();
return mapId;
if (phaseShift.VisibleMapIds.Count == 1)
return phaseShift.VisibleMapIds.First().Key;
@@ -580,7 +580,7 @@ namespace Game
if (terrain.HasChildTerrainGridFile(visibleMap.Key, gx, gy))
return visibleMap.Key;
return terrain.GetId();
return mapId;
}
public static void SetAlwaysVisible(WorldObject obj, bool apply, bool updateVisibility)