aboutsummaryrefslogtreecommitdiff
path: root/src/common/Collision/Maps/MapTree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Collision/Maps/MapTree.cpp')
-rw-r--r--src/common/Collision/Maps/MapTree.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/Collision/Maps/MapTree.cpp b/src/common/Collision/Maps/MapTree.cpp
index d6d866be406..a9ed75414c8 100644
--- a/src/common/Collision/Maps/MapTree.cpp
+++ b/src/common/Collision/Maps/MapTree.cpp
@@ -243,10 +243,14 @@ namespace VMAP
if (!result.File)
{
int32 parentMapId = vm->getParentMapId(mapID);
- if (parentMapId != -1)
+ while (parentMapId != -1)
{
result.Name = basePath + getTileFileName(parentMapId, tileX, tileY);
result.File = fopen(result.Name.c_str(), "rb");
+ if (result.File)
+ break;
+
+ parentMapId = vm->getParentMapId(uint32(parentMapId));
}
}