diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-10-02 13:43:45 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-10-02 13:43:45 +0200 |
| commit | 6b41c3d3274653605b42f1144f554fe43eee344e (patch) | |
| tree | c8d515ce67ade9b7f360e157c3798d25ffb7aa23 /src/server/game | |
| parent | ca70a5c1a0b597b201603e48051d5a0623bd5248 (diff) | |
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)
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/Maps/TerrainMgr.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/server/game/Maps/TerrainMgr.cpp b/src/server/game/Maps/TerrainMgr.cpp index a18373dc248..2e6d8e184b9 100644 --- a/src/server/game/Maps/TerrainMgr.cpp +++ b/src/server/game/Maps/TerrainMgr.cpp @@ -239,12 +239,21 @@ void TerrainInfo::LoadMMap(int32 gx, int32 gy) if (!DisableMgr::IsPathfindingEnabled(GetId())) return; - bool mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap(sWorld->GetDataPath(), GetId(), gx, gy); - - if (mmapLoadResult) - TC_LOG_DEBUG("mmaps.tiles", "MMAP loaded name:{}, id:{}, x:{}, y:{} (mmap rep.: x:{}, y:{})", GetMapName(), GetId(), gx, gy, gx, gy); - else - TC_LOG_WARN("mmaps.tiles", "Could not load MMAP name:{}, id:{}, x:{}, y:{} (mmap rep.: x:{}, y:{})", GetMapName(), GetId(), gx, gy, gx, gy); + switch (MMAP::LoadResult mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap(sWorld->GetDataPath(), GetId(), gx, gy)) + { + case MMAP::LoadResult::Success: + TC_LOG_DEBUG("mmaps.tiles", "MMAP loaded name:{}, id:{}, x:{}, y:{} (mmap rep.: x:{}, y:{})", GetMapName(), GetId(), gx, gy, gx, gy); + break; + case MMAP::LoadResult::AlreadyLoaded: + break; + case MMAP::LoadResult::FileNotFound: + if (_parentTerrain) + break; // don't log tile not found errors for child maps + [[fallthrough]]; + default: + TC_LOG_WARN("mmaps.tiles", "Could not load MMAP name:{}, id:{}, x:{}, y:{} (mmap rep.: x:{}, y:{}) result: {}", GetMapName(), GetId(), gx, gy, gx, gy, AsUnderlyingType(mmapLoadResult)); + break; + } } void TerrainInfo::UnloadMap(int32 gx, int32 gy) |
