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)
This commit is contained in:
Shauren
2025-10-02 13:43:45 +02:00
parent ca70a5c1a0
commit 6b41c3d327
5 changed files with 93 additions and 49 deletions

View File

@@ -138,11 +138,12 @@ public:
float x, y, z;
player->GetPosition(x, y, z);
handler->PSendSysMessage("%04u%02i%02i.mmtile", player->GetMapId(), gx, gy);
handler->PSendSysMessage("tileloc [%i, %i]", gy, gx);
// calculate navmesh tile location
uint32 terrainMapId = PhasingHandler::GetTerrainMapId(player->GetPhaseShift(), player->GetMapId(), player->GetMap()->GetTerrain(), x, y);
handler->PSendSysMessage("%04u%02i%02i.mmtile", terrainMapId, gx, gy);
handler->PSendSysMessage("tileloc [%i, %i]", gy, gx);
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(terrainMapId);
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(terrainMapId, player->GetMapId(), player->GetInstanceId());
if (!navmesh || !navmeshquery)