Core/Maps: Improvements to terrain swap handling

* Fixed memory leak when unloading grids
* Handle child maps being entered
* Allow chaining more child maps (Draenor -> Tanaan Jungle -> Tanaan Jungle - No Hubs Phase)
This commit is contained in:
Shauren authored and Ovahlord committed 2020-06-11 01:35:27 +02:00
1 parent 8adca7637b
commit 40f80fc0ed
13 files changed
+185 -159

No files matched your search

+5 -1
View File
@@ -242,10 +242,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));
}
}