Core/MMaps: Improve mmap debugging experience for terrain swap maps

* Output terrain map id in `.mmap loc` command
* Suppress file not found errors for terrain swap maps
* Fix generating single tiles for terrain swap maps (--tile argument)
Port From (https://github.com/TrinityCore/TrinityCore/commit/6b41c3d3274653605b42f1144f554fe43eee344e)
This commit is contained in:
Hondacrx
2025-12-08 14:48:05 -05:00
parent 34e6130754
commit cef7237f8a
3 changed files with 69 additions and 34 deletions
+4 -3
View File
@@ -90,11 +90,12 @@ namespace Game.Chat
float x, y, z;
player.GetPosition(out x, out y, out z);
handler.SendSysMessage("{0:D4}{1:D2}{2:D2}.mmtile", player.GetMapId(), gy, gx);
handler.SendSysMessage("tileloc [{0}, {1}]", gx, gy);
// calculate navmesh tile location
uint terrainMapId = PhasingHandler.GetTerrainMapId(player.GetPhaseShift(), player.GetMapId(), player.GetMap().GetTerrain(), x, y);
handler.SendSysMessage($"{terrainMapId:D4}{gx:D2}{gy:D2}.mmtile");
handler.SendSysMessage($"tileloc [{gy}, {gx}]");
Detour.dtNavMesh navmesh = Global.MMapMgr.GetNavMesh(terrainMapId);
Detour.dtNavMeshQuery navmeshquery = Global.MMapMgr.GetNavMeshQuery(terrainMapId, player.GetMapId(), player.GetInstanceId());
if (navmesh == null || navmeshquery == null)