diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-12-07 16:23:55 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-12-08 18:16:47 +0100 |
commit | 7a406db50626ba9e9a64c8c3d9b6e5b7310ac527 (patch) | |
tree | 2003395f4b837acbf5e867af90614ecba7a55ab5 /src/common/Collision/Management/VMapManager2.cpp | |
parent | 96d340f70ccef57fad177a24ca099055d7dce04d (diff) |
Core/Collision: Fixed false positive errors in console about vmap loading
Diffstat (limited to 'src/common/Collision/Management/VMapManager2.cpp')
-rw-r--r-- | src/common/Collision/Management/VMapManager2.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/common/Collision/Management/VMapManager2.cpp b/src/common/Collision/Management/VMapManager2.cpp index 88494d0a0c7..ed4e5535250 100644 --- a/src/common/Collision/Management/VMapManager2.cpp +++ b/src/common/Collision/Management/VMapManager2.cpp @@ -104,14 +104,21 @@ namespace VMAP int result = VMAP_LOAD_RESULT_IGNORED; if (isMapLoadingEnabled()) { - if (loadSingleMap(mapId, basePath, x, y)) + LoadResult parentLoadResult = loadSingleMap(mapId, basePath, x, y); + if (parentLoadResult == LoadResult::Success || parentLoadResult == LoadResult::FileNotFound) { - result = VMAP_LOAD_RESULT_OK; + if (parentLoadResult == LoadResult::Success) + result = VMAP_LOAD_RESULT_OK; + // else VMAP_LOAD_RESULT_IGNORED + auto childMaps = iChildMapData.find(mapId); if (childMaps != iChildMapData.end()) for (uint32 childMapId : childMaps->second) - if (!loadSingleMap(childMapId, basePath, x, y)) + { + LoadResult childLoadResult = loadSingleMap(childMapId, basePath, x, y); + if (childLoadResult != LoadResult::Success && childLoadResult != LoadResult::FileNotFound) result = VMAP_LOAD_RESULT_ERROR; + } } else result = VMAP_LOAD_RESULT_ERROR; @@ -121,7 +128,7 @@ namespace VMAP } // load one tile (internal use only) - bool VMapManager2::loadSingleMap(uint32 mapId, const std::string& basePath, uint32 tileX, uint32 tileY) + LoadResult VMapManager2::loadSingleMap(uint32 mapId, const std::string& basePath, uint32 tileX, uint32 tileY) { auto instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree == iInstanceMapTrees.end()) @@ -137,10 +144,11 @@ namespace VMAP { std::string mapFileName = getMapFileName(mapId); StaticMapTree* newTree = new StaticMapTree(mapId, basePath); - if (!newTree->InitMap(mapFileName)) + LoadResult treeInitResult = newTree->InitMap(mapFileName); + if (treeInitResult != LoadResult::Success) { delete newTree; - return false; + return treeInitResult; } instanceTree->second = newTree; } |