From fe4f86b1bcad4b462d65c8e7ce2c0e1e6063ce2e Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 9 Mar 2018 18:17:27 +0100 Subject: [PATCH] Core/VMaps: fixed build, vmaps extraction and some copy paste fails --- src/common/Collision/Management/VMapManager2.cpp | 1 + src/common/Collision/Maps/MapTree.cpp | 2 +- src/tools/vmap4_extractor/vmapexport.cpp | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/Collision/Management/VMapManager2.cpp b/src/common/Collision/Management/VMapManager2.cpp index 29ce04ae2fb..91e4547149c 100644 --- a/src/common/Collision/Management/VMapManager2.cpp +++ b/src/common/Collision/Management/VMapManager2.cpp @@ -91,6 +91,7 @@ namespace VMAP int VMapManager2::loadMap(const char* basePath, unsigned int mapId, int x, int y) { int result = VMAP_LOAD_RESULT_IGNORED; + if (isMapLoadingEnabled()) { if (_loadMap(mapId, basePath, x, y)) { diff --git a/src/common/Collision/Maps/MapTree.cpp b/src/common/Collision/Maps/MapTree.cpp index e22cfe3f9be..55b5eb8fadf 100644 --- a/src/common/Collision/Maps/MapTree.cpp +++ b/src/common/Collision/Maps/MapTree.cpp @@ -426,7 +426,7 @@ namespace VMAP { if (referencedVal >= iNTreeValues) { - VMAP_ERROR_LOG("maps", "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u) referenced in tile %s", referencedVal, iNTreeValues, tilefile.c_str()); + VMAP_ERROR_LOG("maps", "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u) referenced in tile %s", referencedVal, iNTreeValues, fileResult.Name.c_str()); continue; } diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index 59a28188eab..5ee5cb8c189 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -603,7 +603,7 @@ int main(int argc, char ** argv) { map_info& m = map_ids[dbc->getRecord(x).getUInt(0)]; - const char* map_name = dbc->getRecord(x).getString(6); + const char* map_name = dbc->getRecord(x).getString(1); size_t max_map_name_length = sizeof(m.name); if (strlen(map_name) >= max_map_name_length) { @@ -612,12 +612,12 @@ int main(int argc, char ** argv) } strncpy(m.name, map_name, max_map_name_length); - map_ids[x].name[max_map_name_length - 1] = '\0'; + m.name[max_map_name_length - 1] = '\0'; m.parent_id = int16(dbc->getRecord(x).getUInt(19)); if (m.parent_id >= 0) maps_that_are_parents.insert(m.parent_id); - printf("Map - %s\n", map_ids[x].name); + printf("Map - %s\n", m.name); } ParsMapFiles();