From 609a02d7771c906690198ebc2404a2ec814737cb Mon Sep 17 00:00:00 2001 From: billy1arm Date: Mon, 8 Jun 2026 20:49:58 +0100 Subject: [PATCH 01/10] Maps/Vmaps and MMaps Digit change --- src/game/ChatCommands/MMapCommands.cpp | 2 +- src/game/WorldHandlers/GridMap.cpp | 8 ++-- src/game/WorldHandlers/MoveMap.cpp | 56 +++++++++++++------------- src/game/vmap/MapTree.cpp | 2 +- src/game/vmap/TileAssembler.cpp | 4 +- src/game/vmap/VMapManager2.cpp | 2 +- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/game/ChatCommands/MMapCommands.cpp b/src/game/ChatCommands/MMapCommands.cpp index 1146da321..b491df4c9 100644 --- a/src/game/ChatCommands/MMapCommands.cpp +++ b/src/game/ChatCommands/MMapCommands.cpp @@ -175,7 +175,7 @@ bool ChatHandler::HandleMmapLocCommand(char* /*args*/) int32 gx = 32 - player->GetPositionX() / SIZE_OF_GRIDS; int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS; - PSendSysMessage("%03u%02i%02i.mmtile", player->GetMapId(), gy, gx); + PSendSysMessage("%04u%02i%02i.mmtile", player->GetMapId(), gy, gx); PSendSysMessage("gridloc [%i,%i]", gx, gy); // calculate navmesh tile location diff --git a/src/game/WorldHandlers/GridMap.cpp b/src/game/WorldHandlers/GridMap.cpp index 06065db8a..8b711017d 100644 --- a/src/game/WorldHandlers/GridMap.cpp +++ b/src/game/WorldHandlers/GridMap.cpp @@ -874,9 +874,9 @@ GridMapLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 Re */ bool GridMap::ExistMap(uint32 mapid, int gx, int gy) { - int len = sWorld.GetDataPath().length() + strlen("maps/%03u%02u%02u.map") + 1; + int len = sWorld.GetDataPath().length() + strlen("maps/%04u%02u%02u.map") + 1; char* tmp = new char[len]; - snprintf(tmp, len, (char*)(sWorld.GetDataPath() + "maps/%03u%02u%02u.map").c_str(), mapid, gx, gy); + snprintf(tmp, len, (char*)(sWorld.GetDataPath() + "maps/%04u%02u%02u.map").c_str(), mapid, gx, gy); FILE* pf = fopen(tmp, "rb"); @@ -1566,9 +1566,9 @@ GridMap* TerrainInfo::LoadMapAndVMap(const uint32 x, const uint32 y) GridMap* map = new GridMap(); // map file name - int len = sWorld.GetDataPath().length() + strlen("maps/%03u%02u%02u.map") + 1; + int len = sWorld.GetDataPath().length() + strlen("maps/%04u%02u%02u.map") + 1; char* tmp = new char[len]; - snprintf(tmp, len, (char*)(sWorld.GetDataPath() + "maps/%03u%02u%02u.map").c_str(), m_mapId, x, y); + snprintf(tmp, len, (char*)(sWorld.GetDataPath() + "maps/%04u%02u%02u.map").c_str(), m_mapId, x, y); DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "Loading map %s", tmp); if (!map->loadData(tmp)) diff --git a/src/game/WorldHandlers/MoveMap.cpp b/src/game/WorldHandlers/MoveMap.cpp index e405bc32d..f11474b92 100644 --- a/src/game/WorldHandlers/MoveMap.cpp +++ b/src/game/WorldHandlers/MoveMap.cpp @@ -239,9 +239,9 @@ namespace MMAP } // load and init dtNavMesh - read parameters from file - uint32 pathLen = sWorld.GetDataPath().length() + strlen("mmaps/%03i.mmap") + 1; + uint32 pathLen = sWorld.GetDataPath().length() + strlen("mmaps/%04i.mmap") + 1; char* fileName = new char[pathLen]; - snprintf(fileName, pathLen, (sWorld.GetDataPath() + "mmaps/%03i.mmap").c_str(), mapId); + snprintf(fileName, pathLen, (sWorld.GetDataPath() + "mmaps/%04i.mmap").c_str(), mapId); FILE* file = fopen(fileName, "rb"); if (!file) @@ -258,7 +258,7 @@ namespace MMAP size_t file_read = fread(¶ms, sizeof(dtNavMeshParams), 1, file); if (file_read <= 0) { - sLog.outError("MMAP:loadMapData: Failed to load mmap %03u from file %s", mapId, fileName); + sLog.outError("MMAP:loadMapData: Failed to load mmap %04u from file %s", mapId, fileName); delete[] fileName; fclose(file); return false; @@ -271,14 +271,14 @@ namespace MMAP if (dtStatusFailed(dtResult)) { dtFreeNavMesh(mesh); - sLog.outError("MMAP:loadMapData: Failed to initialize dtNavMesh for mmap %03u from file %s", mapId, fileName); + sLog.outError("MMAP:loadMapData: Failed to initialize dtNavMesh for mmap %04u from file %s", mapId, fileName); delete[] fileName; return false; } delete[] fileName; - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:loadMapData: Loaded %03i.mmap", mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:loadMapData: Loaded %04i.mmap", mapId); // store inside our map list MMapData* mmap_data = new MMapData(mesh); @@ -309,7 +309,7 @@ namespace MMAP uint32 packedGridPos = packTileID(x, y); if (mmap->mmapLoadedTiles.find(packedGridPos) != mmap->mmapLoadedTiles.end()) { - sLog.outError("MMAP:loadMap: Asked to load already loaded navmesh tile. %03u%02i%02i.mmtile", mapId, x, y); + sLog.outError("MMAP:loadMap: Asked to load already loaded navmesh tile. %04u%02i%02i.mmtile", mapId, x, y); return false; } @@ -317,12 +317,12 @@ namespace MMAP const int32 filenameTileX = y; const int32 filenameTileY = x; - // load this tile :: mmaps/MMMYYXX.mmtile + // load this tile :: mmaps/MMMXXYY.mmtile uint32 pathLen = sWorld.GetDataPath().length() + - strlen("mmaps/%03i%02i%02i.mmtile") + 1; + strlen("mmaps/%04i%02i%02i.mmtile") + 1; char* fileName = new char[pathLen]; snprintf(fileName, pathLen, - (sWorld.GetDataPath() + "mmaps/%03i%02i%02i.mmtile").c_str(), + (sWorld.GetDataPath() + "mmaps/%04i%02i%02i.mmtile").c_str(), mapId, filenameTileX, filenameTileY); FILE* file = fopen(fileName, "rb"); @@ -341,7 +341,7 @@ namespace MMAP if (file_read <= 0) { sLog.outError("MMAP:loadMap: Could not load mmap " - "%03u%02i%02i.mmtile", + "%04u%02i%02i.mmtile", mapId, filenameTileX, filenameTileY); fclose(file); return false; @@ -350,7 +350,7 @@ namespace MMAP if (fileHeader.mmapMagic != MMAP_MAGIC) { sLog.outError("MMAP:loadMap: Bad header in mmap " - "%03u%02i%02i.mmtile", + "%04u%02i%02i.mmtile", mapId, filenameTileX, filenameTileY); fclose(file); return false; @@ -358,7 +358,7 @@ namespace MMAP if (fileHeader.mmapVersion != MMAP_VERSION) { - sLog.outError("MMAP:loadMap: %03u%02i%02i.mmtile was built " + sLog.outError("MMAP:loadMap: %04u%02i%02i.mmtile was built " "with generator v%i, expected v%i", mapId, filenameTileX, filenameTileY, fileHeader.mmapVersion, MMAP_VERSION); @@ -373,7 +373,7 @@ namespace MMAP if (!result) { sLog.outError("MMAP:loadMap: Bad header or data in mmap " - "%03u%02i%02i.mmtile", + "%04u%02i%02i.mmtile", mapId, filenameTileX, filenameTileY); fclose(file); return false; @@ -389,7 +389,7 @@ namespace MMAP if (dtStatusFailed(dtResult)) { sLog.outError("MMAP:loadMap: Could not load " - "%03u%02i%02i.mmtile into navmesh", + "%04u%02i%02i.mmtile into navmesh", mapId, filenameTileX, filenameTileY); dtFree(data); return false; @@ -399,7 +399,7 @@ namespace MMAP ++loadedTiles; DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:loadMap: Loaded mmtile " - "%03i[%02i,%02i] into %03i[%02i,%02i]", + "%04i[%02i,%02i] into %04i[%02i,%02i]", mapId, filenameTileX, filenameTileY, mapId, header->x, header->y); return true; @@ -411,7 +411,7 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Asked to unload not loaded navmesh map. %03u%02i%02i.mmtile", mapId, x, y); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Asked to unload not loaded navmesh map. %04u%02i%02i.mmtile", mapId, x, y); return false; } @@ -422,7 +422,7 @@ namespace MMAP if (mmap->mmapLoadedTiles.find(packedGridPos) == mmap->mmapLoadedTiles.end()) { // file may not exist, therefore not loaded - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Asked to unload not loaded navmesh tile. %03u%02i%02i.mmtile", mapId, x, y); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Asked to unload not loaded navmesh tile. %04u%02i%02i.mmtile", mapId, x, y); return false; } @@ -435,14 +435,14 @@ namespace MMAP // this is technically a memory leak // if the grid is later reloaded, dtNavMesh::addTile will return error but no extra memory is used // we can not recover from this error - assert out - sLog.outError("MMAP:unloadMap: Could not unload %03u%02i%02i.mmtile from navmesh", mapId, x, y); + sLog.outError("MMAP:unloadMap: Could not unload %04u%02i%02i.mmtile from navmesh", mapId, x, y); MANGOS_ASSERT(false); } else { mmap->mmapLoadedTiles.erase(packedGridPos); --loadedTiles; - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04i[%02i,%02i] from %04i", mapId, x, y, mapId); return true; } @@ -454,7 +454,7 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Asked to unload not loaded navmesh map %03u", mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Asked to unload not loaded navmesh map %04u", mapId); return false; } @@ -467,18 +467,18 @@ namespace MMAP dtStatus dtResult = mmap->navMesh->removeTile(i->second, NULL, NULL); if (dtStatusFailed(dtResult)) { - sLog.outError("MMAP:unloadMap: Could not unload %03u%02i%02i.mmtile from navmesh", mapId, x, y); + sLog.outError("MMAP:unloadMap: Could not unload %04u%02i%02i.mmtile from navmesh", mapId, x, y); } else { --loadedTiles; - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04i[%02i,%02i] from %04i", mapId, x, y, mapId); } } delete mmap; loadedMMaps.erase(mapId); - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded %03i.mmap", mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded %04i.mmap", mapId); return true; } @@ -489,14 +489,14 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMapInstance: Asked to unload not loaded navmesh map %03u", mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMapInstance: Asked to unload not loaded navmesh map %04u", mapId); return false; } MMapData* mmap = loadedMMaps[mapId]; if (mmap->navMeshQueries.find(instanceId) == mmap->navMeshQueries.end()) { - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMapInstance: Asked to unload not loaded dtNavMeshQuery mapId %03u instanceId %u", mapId, instanceId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMapInstance: Asked to unload not loaded dtNavMeshQuery mapId %04u instanceId %u", mapId, instanceId); return false; } @@ -504,7 +504,7 @@ namespace MMAP dtFreeNavMeshQuery(query); mmap->navMeshQueries.erase(instanceId); - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMapInstance: Unloaded mapId %03u instanceId %u", mapId, instanceId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMapInstance: Unloaded mapId %04u instanceId %u", mapId, instanceId); return true; } @@ -536,11 +536,11 @@ namespace MMAP if (dtStatusFailed(dtResult)) { dtFreeNavMeshQuery(query); - sLog.outError("MMAP:GetNavMeshQuery: Failed to initialize dtNavMeshQuery for mapId %03u instanceId %u", mapId, instanceId); + sLog.outError("MMAP:GetNavMeshQuery: Failed to initialize dtNavMeshQuery for mapId %04u instanceId %u", mapId, instanceId); return NULL; } - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:GetNavMeshQuery: created dtNavMeshQuery for mapId %03u instanceId %u", mapId, instanceId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:GetNavMeshQuery: created dtNavMeshQuery for mapId %04u instanceId %u", mapId, instanceId); mmap->navMeshQueries.insert(std::pair(instanceId, query)); } diff --git a/src/game/vmap/MapTree.cpp b/src/game/vmap/MapTree.cpp index dee3253e5..911d66c43 100644 --- a/src/game/vmap/MapTree.cpp +++ b/src/game/vmap/MapTree.cpp @@ -162,7 +162,7 @@ namespace VMAP { std::stringstream tilefilename; tilefilename.fill('0'); - tilefilename << std::setw(3) << mapID << "_"; + tilefilename << std::setw(4) << mapID << "_"; tilefilename << std::setw(2) << tileY << "_" << std::setw(2) << tileX << ".vmtile"; return tilefilename.str(); } diff --git a/src/game/vmap/TileAssembler.cpp b/src/game/vmap/TileAssembler.cpp index c07554c7a..758140088 100644 --- a/src/game/vmap/TileAssembler.cpp +++ b/src/game/vmap/TileAssembler.cpp @@ -174,7 +174,7 @@ namespace VMAP // Write map tree file std::stringstream mapfilename; - mapfilename << iDestDir << "/" << std::setfill('0') << std::setw(3) << map_iter->first << ".vmtree"; + mapfilename << iDestDir << "/" << std::setfill('0') << std::setw(4) << map_iter->first << ".vmtree"; FILE* mapfile = fopen(mapfilename.str().c_str(), "wb"); if (!mapfile) { @@ -232,7 +232,7 @@ namespace VMAP uint32 nSpawns = tileEntries.count(tile->first); std::stringstream tilefilename; tilefilename.fill('0'); - tilefilename << iDestDir << "/" << std::setw(3) << map_iter->first << "_"; + tilefilename << iDestDir << "/" << std::setw(4) << map_iter->first << "_"; uint32 x, y; StaticMapTree::unpackTileID(tile->first, x, y); tilefilename << std::setw(2) << x << "_" << std::setw(2) << y << ".vmtile"; diff --git a/src/game/vmap/VMapManager2.cpp b/src/game/vmap/VMapManager2.cpp index f7f747b1d..76bcb23d8 100644 --- a/src/game/vmap/VMapManager2.cpp +++ b/src/game/vmap/VMapManager2.cpp @@ -106,7 +106,7 @@ namespace VMAP std::string VMapManager2::getMapFileName(unsigned int pMapId) { std::stringstream fname; - fname.width(3); + fname.width(4); fname << std::setfill('0') << pMapId << std::string(MAP_FILENAME_EXTENSION2); return fname.str(); } From 35d03416d3f46acf745c41f548c2026e2278d54b Mon Sep 17 00:00:00 2001 From: billy1arm Date: Tue, 9 Jun 2026 06:58:03 +0100 Subject: [PATCH 02/10] Some more x, y transposed --- src/game/vmap/MapTree.cpp | 2 +- src/game/vmap/MapTree.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/vmap/MapTree.cpp b/src/game/vmap/MapTree.cpp index 911d66c43..fbd1d99ee 100644 --- a/src/game/vmap/MapTree.cpp +++ b/src/game/vmap/MapTree.cpp @@ -163,7 +163,7 @@ namespace VMAP std::stringstream tilefilename; tilefilename.fill('0'); tilefilename << std::setw(4) << mapID << "_"; - tilefilename << std::setw(2) << tileY << "_" << std::setw(2) << tileX << ".vmtile"; + tilefilename << std::setw(2) << tileX << "_" << std::setw(2) << tileY << ".vmtile"; return tilefilename.str(); } diff --git a/src/game/vmap/MapTree.h b/src/game/vmap/MapTree.h index df776f035..853d642fd 100644 --- a/src/game/vmap/MapTree.h +++ b/src/game/vmap/MapTree.h @@ -119,7 +119,7 @@ namespace VMAP * @param tileX The tile X coordinate. * @param tileY The tile Y coordinate. */ - static void unpackTileID(uint32 ID, uint32& tileX, uint32& tileY) { tileX = ID >> 16; tileY = ID & 0xFF; } + static void unpackTileID(uint32 ID, uint32& tileX, uint32& tileY) { tileX = ID >> 16; tileY = ID & 0xFFFF; } /** * @brief Checks if a map can be loaded. From 58e444ab71f819036a88e6384ec3b82028a1f951 Mon Sep 17 00:00:00 2001 From: Antz Date: Tue, 9 Jun 2026 09:15:41 +0100 Subject: [PATCH 03/10] Change format specifiers from %i to %u for mapId --- src/game/WorldHandlers/MoveMap.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/game/WorldHandlers/MoveMap.cpp b/src/game/WorldHandlers/MoveMap.cpp index f11474b92..aa0dba3a5 100644 --- a/src/game/WorldHandlers/MoveMap.cpp +++ b/src/game/WorldHandlers/MoveMap.cpp @@ -241,7 +241,7 @@ namespace MMAP // load and init dtNavMesh - read parameters from file uint32 pathLen = sWorld.GetDataPath().length() + strlen("mmaps/%04i.mmap") + 1; char* fileName = new char[pathLen]; - snprintf(fileName, pathLen, (sWorld.GetDataPath() + "mmaps/%04i.mmap").c_str(), mapId); + snprintf(fileName, pathLen, (sWorld.GetDataPath() + "mmaps/%04u.mmap").c_str(), mapId); FILE* file = fopen(fileName, "rb"); if (!file) @@ -278,7 +278,7 @@ namespace MMAP delete[] fileName; - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:loadMapData: Loaded %04i.mmap", mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:loadMapData: Loaded %04u.mmap", mapId); // store inside our map list MMapData* mmap_data = new MMapData(mesh); @@ -314,15 +314,15 @@ namespace MMAP } // MMap tile files follow the same swapped grid order as VMap tiles. - const int32 filenameTileX = y; - const int32 filenameTileY = x; + const int32 filenameTileX = x; + const int32 filenameTileY = y; // load this tile :: mmaps/MMMXXYY.mmtile uint32 pathLen = sWorld.GetDataPath().length() + - strlen("mmaps/%04i%02i%02i.mmtile") + 1; + strlen("mmaps/%04u%02i%02i.mmtile") + 1; char* fileName = new char[pathLen]; snprintf(fileName, pathLen, - (sWorld.GetDataPath() + "mmaps/%04i%02i%02i.mmtile").c_str(), + (sWorld.GetDataPath() + "mmaps/%04u%02i%02i.mmtile").c_str(), mapId, filenameTileX, filenameTileY); FILE* file = fopen(fileName, "rb"); @@ -399,7 +399,7 @@ namespace MMAP ++loadedTiles; DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:loadMap: Loaded mmtile " - "%04i[%02i,%02i] into %04i[%02i,%02i]", + "%04u[%02i,%02i] into %04u[%02i,%02i]", mapId, filenameTileX, filenameTileY, mapId, header->x, header->y); return true; @@ -442,7 +442,7 @@ namespace MMAP { mmap->mmapLoadedTiles.erase(packedGridPos); --loadedTiles; - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04i[%02i,%02i] from %04i", mapId, x, y, mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04u[%02i,%02i] from %04i", mapId, x, y, mapId); return true; } @@ -472,13 +472,13 @@ namespace MMAP else { --loadedTiles; - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04i[%02i,%02i] from %04i", mapId, x, y, mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04u[%02i,%02i] from %04i", mapId, x, y, mapId); } } delete mmap; loadedMMaps.erase(mapId); - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded %04i.mmap", mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded %04u.mmap", mapId); return true; } From 6e95c3a45e450e254afcec4ed3e24aa1a5183c01 Mon Sep 17 00:00:00 2001 From: Antz Date: Tue, 9 Jun 2026 09:16:48 +0100 Subject: [PATCH 04/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/game/WorldHandlers/GridMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/WorldHandlers/GridMap.cpp b/src/game/WorldHandlers/GridMap.cpp index 8b711017d..31be70393 100644 --- a/src/game/WorldHandlers/GridMap.cpp +++ b/src/game/WorldHandlers/GridMap.cpp @@ -876,7 +876,7 @@ bool GridMap::ExistMap(uint32 mapid, int gx, int gy) { int len = sWorld.GetDataPath().length() + strlen("maps/%04u%02u%02u.map") + 1; char* tmp = new char[len]; - snprintf(tmp, len, (char*)(sWorld.GetDataPath() + "maps/%04u%02u%02u.map").c_str(), mapid, gx, gy); + snprintf(tmp, len, (char*)(sWorld.GetDataPath() + "maps/%04u%02u%02u.map").c_str(), mapid, (unsigned)gx, (unsigned)gy); FILE* pf = fopen(tmp, "rb"); From f8bd7483c485f939f53b763ab2253a2edc8d09d1 Mon Sep 17 00:00:00 2001 From: Antz Date: Tue, 9 Jun 2026 09:20:27 +0100 Subject: [PATCH 05/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/game/ChatCommands/MMapCommands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/ChatCommands/MMapCommands.cpp b/src/game/ChatCommands/MMapCommands.cpp index b491df4c9..39cdb2086 100644 --- a/src/game/ChatCommands/MMapCommands.cpp +++ b/src/game/ChatCommands/MMapCommands.cpp @@ -175,7 +175,7 @@ bool ChatHandler::HandleMmapLocCommand(char* /*args*/) int32 gx = 32 - player->GetPositionX() / SIZE_OF_GRIDS; int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS; - PSendSysMessage("%04u%02i%02i.mmtile", player->GetMapId(), gy, gx); + PSendSysMessage("%04u%02i%02i.mmtile", player->GetMapId(), gx, gy); PSendSysMessage("gridloc [%i,%i]", gx, gy); // calculate navmesh tile location From 3fd316bebf25a44991d8940a06aa9d51cdb130a9 Mon Sep 17 00:00:00 2001 From: Antz Date: Tue, 9 Jun 2026 09:21:05 +0100 Subject: [PATCH 06/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/game/WorldHandlers/MoveMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/WorldHandlers/MoveMap.cpp b/src/game/WorldHandlers/MoveMap.cpp index aa0dba3a5..f3595369c 100644 --- a/src/game/WorldHandlers/MoveMap.cpp +++ b/src/game/WorldHandlers/MoveMap.cpp @@ -239,7 +239,7 @@ namespace MMAP } // load and init dtNavMesh - read parameters from file - uint32 pathLen = sWorld.GetDataPath().length() + strlen("mmaps/%04i.mmap") + 1; + uint32 pathLen = sWorld.GetDataPath().length() + strlen("mmaps/%04u.mmap") + 1; char* fileName = new char[pathLen]; snprintf(fileName, pathLen, (sWorld.GetDataPath() + "mmaps/%04u.mmap").c_str(), mapId); From b783d1ffb2b740c22a08d65d791f6d3fa9f4da8b Mon Sep 17 00:00:00 2001 From: Antz Date: Tue, 9 Jun 2026 09:21:42 +0100 Subject: [PATCH 07/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/game/WorldHandlers/MoveMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/WorldHandlers/MoveMap.cpp b/src/game/WorldHandlers/MoveMap.cpp index f3595369c..78ae20a11 100644 --- a/src/game/WorldHandlers/MoveMap.cpp +++ b/src/game/WorldHandlers/MoveMap.cpp @@ -313,7 +313,7 @@ namespace MMAP return false; } - // MMap tile files follow the same swapped grid order as VMap tiles. + // MMap tile files follow the same grid order as VMap tiles. const int32 filenameTileX = x; const int32 filenameTileY = y; From 3d0602f03b4e56e0b7ed8f9986fb135ce6380043 Mon Sep 17 00:00:00 2001 From: Antz Date: Tue, 9 Jun 2026 09:22:20 +0100 Subject: [PATCH 08/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/game/WorldHandlers/MoveMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/WorldHandlers/MoveMap.cpp b/src/game/WorldHandlers/MoveMap.cpp index 78ae20a11..cd63864f5 100644 --- a/src/game/WorldHandlers/MoveMap.cpp +++ b/src/game/WorldHandlers/MoveMap.cpp @@ -467,7 +467,7 @@ namespace MMAP dtStatus dtResult = mmap->navMesh->removeTile(i->second, NULL, NULL); if (dtStatusFailed(dtResult)) { - sLog.outError("MMAP:unloadMap: Could not unload %04u%02i%02i.mmtile from navmesh", mapId, x, y); + sLog.outError("MMAP:unloadMap: Could not unload %04u%02u%02u.mmtile from navmesh", mapId, x, y); } else { From da609828cca4ac85f14311a6a1fd434c70acdfb1 Mon Sep 17 00:00:00 2001 From: Antz Date: Tue, 9 Jun 2026 12:01:30 +0100 Subject: [PATCH 09/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/game/WorldHandlers/MoveMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/WorldHandlers/MoveMap.cpp b/src/game/WorldHandlers/MoveMap.cpp index cd63864f5..6af5cc2a5 100644 --- a/src/game/WorldHandlers/MoveMap.cpp +++ b/src/game/WorldHandlers/MoveMap.cpp @@ -442,7 +442,7 @@ namespace MMAP { mmap->mmapLoadedTiles.erase(packedGridPos); --loadedTiles; - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04u[%02i,%02i] from %04i", mapId, x, y, mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04u[%02i,%02i] from %04u", mapId, x, y, mapId); return true; } From c05a790bb1572fe48f6a6540d326876f6a0b8887 Mon Sep 17 00:00:00 2001 From: Antz Date: Tue, 9 Jun 2026 12:02:40 +0100 Subject: [PATCH 10/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/game/WorldHandlers/MoveMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/WorldHandlers/MoveMap.cpp b/src/game/WorldHandlers/MoveMap.cpp index 6af5cc2a5..dd231ef6a 100644 --- a/src/game/WorldHandlers/MoveMap.cpp +++ b/src/game/WorldHandlers/MoveMap.cpp @@ -472,7 +472,7 @@ namespace MMAP else { --loadedTiles; - DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04u[%02i,%02i] from %04i", mapId, x, y, mapId); + DEBUG_FILTER_LOG(LOG_FILTER_MAP_LOADING, "MMAP:unloadMap: Unloaded mmtile %04u[%02u,%02u] from %04u", mapId, x, y, mapId); } }