diff options
author | leak <leakzx@googlemail.com> | 2011-03-14 20:38:43 +0100 |
---|---|---|
committer | leak <leakzx@googlemail.com> | 2011-03-14 20:39:05 +0100 |
commit | 6a4ffb4be117838ce5a5257cce419b8ef7537aed (patch) | |
tree | 80850a8920d2bf92e9048a0f0553ec9f3715a295 | |
parent | 28c264402b3a50acd44cb68a17014c63868a67b0 (diff) |
Core/Battlegrounds: Free instance id in the proper place.
fixes #966
-rwxr-xr-x | src/server/game/Battlegrounds/BattlegroundMgr.cpp | 3 | ||||
-rwxr-xr-x | src/server/game/Maps/MapInstanced.cpp | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index d9ed56da58c..e58ba68df46 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -111,9 +111,6 @@ void BattlegroundMgr::Update(uint32 diff) if (!m_ClientBattlegroundIds[i][bg->GetBracketId()].empty()) m_ClientBattlegroundIds[i][bg->GetBracketId()].erase(bg->GetClientInstanceID()); - // Free up the instance id and allow it to be reused - sMapMgr->FreeInstanceId(bg->GetInstanceID()); - delete bg; } } diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 1567bcf2397..7dc126ce237 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -245,9 +245,15 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr) // so in the next map creation, (EnsureGridCreated actually) VMaps will be reloaded Map::UnloadAll(); } + + // Free up the instance id and allow it to be reused for bgs and arenas (other instances are handled in the InstanceSaveMgr) + if (itr->second->IsBattlegroundOrArena()) + sMapMgr->FreeInstanceId(itr->second->GetInstanceId()); + // erase map delete itr->second; m_InstancedMaps.erase(itr++); + return true; } |