diff options
author | Subv <s.v.h21@hotmail.com> | 2012-02-26 14:55:22 -0500 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-02-26 14:57:00 -0500 |
commit | 95d3ea55122921dc7df31e0427de3b1d63f346f2 (patch) | |
tree | 3886da3f59c3956e86ab1ed0c762a6a057b41cbd /src | |
parent | fd9f185f1f22042e45574d7ca05aac419f141d5d (diff) |
Core/Misc: Reserve space for the data in the stores before inserting it
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 11 | ||||
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.h | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f50d4144b62..f31ce74d896 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -389,6 +389,7 @@ void ObjectMgr::LoadCreatureTemplates() return; } + _creatureTemplateStore.rehash(result->GetRowCount()); uint32 count = 0; do { @@ -1104,6 +1105,7 @@ void ObjectMgr::LoadCreatureModelInfo() return; } + _creatureModelStore.rehash(result->GetRowCount()); uint32 count = 0; do @@ -1137,9 +1139,7 @@ void ObjectMgr::LoadCreatureModelInfo() } if (modelInfo.combat_reach < 0.1f) - { modelInfo.combat_reach = DEFAULT_COMBAT_REACH; - } ++count; } @@ -1404,6 +1404,7 @@ void ObjectMgr::LoadCreatures() if (GetMapDifficultyData(i, Difficulty(k))) spawnMasks[i] |= (1 << k); + _creatureDataStore.rehash(result->GetRowCount()); uint32 count = 0; do { @@ -1420,7 +1421,6 @@ void ObjectMgr::LoadCreatures() } CreatureData& data = _creatureDataStore[guid]; - data.id = entry; data.mapid = fields[ 2].GetUInt32(); data.displayid = fields[ 3].GetUInt32(); @@ -1714,6 +1714,7 @@ void ObjectMgr::LoadGameobjects() if (GetMapDifficultyData(i, Difficulty(k))) spawnMasks[i] |= (1 << k); + _gameObjectDataStore.rehash(result->GetRowCount()); do { Field* fields = result->Fetch(); @@ -2085,6 +2086,7 @@ void ObjectMgr::LoadItemTemplates() return; } + _itemTemplateStore.rehash(result->GetRowCount()); uint32 count = 0; bool enforceDBCAttributes = sWorld->getBoolConfig(CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES); @@ -2703,6 +2705,7 @@ void ObjectMgr::LoadItemSetNames() return; } + _itemSetNameStore.rehash(result->GetRowCount()); uint32 count = 0; do @@ -5166,6 +5169,7 @@ void ObjectMgr::LoadGossipText() sLog->outString(); return; } + _gossipTextStore.rehash(result->GetRowCount()); int cic; @@ -6390,6 +6394,7 @@ void ObjectMgr::LoadGameObjectTemplate() return; } + _gameObjectTemplateStore.rehash(result->GetRowCount()); uint32 count = 0; do { diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 4224f1e2bfd..1172f04241d 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -385,6 +385,7 @@ struct TrinityStringLocale StringVector Content; }; + typedef std::map<uint64, uint64> LinkedRespawnContainer; typedef UNORDERED_MAP<uint32, CreatureData> CreatureDataContainer; typedef UNORDERED_MAP<uint32, GameObjectData> GameObjectDataContainer; |