Core/Vmaps: Fixed crash in unloading vmaps

Closes #26536
This commit is contained in:
Shauren
2021-05-21 12:31:21 +02:00
committed by Ovahlord
parent 37d67ac8d2
commit 659cb0992f

View File

@@ -348,9 +348,10 @@ namespace VMAP
{
for (loadedSpawnMap::iterator i = iLoadedSpawns.begin(); i != iLoadedSpawns.end(); ++i)
{
iTreeValues[i->first].setUnloaded();
for (uint32 refCount = 0; refCount < i->second; ++refCount)
vm->releaseModelInstance(iTreeValues[i->first].getWorldModel()->GetName());
iTreeValues[i->first].setUnloaded();
}
iLoadedSpawns.clear();
iLoadedTiles.clear();