diff options
author | leak <leakzx@googlemail.com> | 2011-03-11 13:24:58 +0100 |
---|---|---|
committer | leak <leakzx@googlemail.com> | 2011-03-11 13:24:58 +0100 |
commit | 190ef1c2ef0eac90f90d7f84e8ed20f020b2be11 (patch) | |
tree | 03936f69ece2b53070c59fb3f6b7f68a30ea0a6c /src/server/game/Maps/MapManager.cpp | |
parent | 3973d1b45444c0c8fcd7aa1e033be4329dce05ae (diff) |
Core/Instances: Fix crash and allocation issue in instance id generation
Diffstat (limited to 'src/server/game/Maps/MapManager.cpp')
-rwxr-xr-x | src/server/game/Maps/MapManager.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 45aeebd7c47..d2f86917b8b 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -404,16 +404,12 @@ uint32 MapManager::GenerateInstanceId() // Allocate space if necessary if (newInstanceId >= uint32(_instanceIds.size())) { - // DEBUG CODE - TO BE REMOVED OR ENABLED DEPENDING ON THIS ASSERT TRIGGERING - ASSERT(_instanceIds.size() == _instanceIds.capacity()); - - /* + // Due to the odd memory allocation behavior of vector<bool> we match size to capacity before triggering a new allocation if (_instanceIds.size() < _instanceIds.capacity()) { _instanceIds.resize(_instanceIds.capacity()); } else - */ _instanceIds.resize(floor(newInstanceId / 32.0f) * 32 + (newInstanceId % 32 > 0 ? 32 : 0)); } |