diff options
author | Subv <s.v.h21@hotmail.com> | 2012-02-12 17:34:41 -0500 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-02-12 17:34:41 -0500 |
commit | 06df126bd0d13109c56afbb9054bfb2e539ad839 (patch) | |
tree | e7c7427e2e7ce08d597ad1690b968de9fa4e9731 | |
parent | 11d9f8e161b510fe1200cb253362ca4a00e7819f (diff) |
Core/Loading: Speedup on the creature loading code
Signed-off-by: Subv <s.v.h21@hotmail.com>
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 23 | ||||
-rwxr-xr-x | src/server/game/Loot/LootMgr.cpp | 2 |
2 files changed, 1 insertions, 24 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index dc78489070e..99dc7466db2 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -427,14 +427,10 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.Entry = entry; for (uint8 i = 0; i < MAX_DIFFICULTY - 1; ++i) - { creatureTemplate.DifficultyEntry[i] = fields[1 + i].GetUInt32(); - } for (uint8 i = 0; i < MAX_KILL_CREDIT; ++i) - { creatureTemplate.KillCredit[i] = fields[4 + i].GetUInt32(); - } creatureTemplate.Modelid1 = fields[6].GetUInt32(); creatureTemplate.Modelid2 = fields[7].GetUInt32(); @@ -479,14 +475,10 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.SkinLootId = fields[46].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - { creatureTemplate.resistance[i] = fields[47 + i -1].GetInt32(); - } for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) - { creatureTemplate.spells[i] = fields[53 + i].GetUInt32(); - } creatureTemplate.PetSpellDataId = fields[61].GetUInt32(); creatureTemplate.VehicleId = fields[62].GetUInt32(); @@ -501,9 +493,7 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.RacialLeader = fields[71].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - { creatureTemplate.questItems[i] = fields[72 + i].GetUInt32(); - } creatureTemplate.movementId = fields[78].GetUInt32(); creatureTemplate.RegenHealth = fields[79].GetBool(); @@ -518,9 +508,7 @@ void ObjectMgr::LoadCreatureTemplates() // Checking needs to be done after loading because of the difficulty self referencing for (CreatureTemplateContainer::const_iterator itr = CreatureTemplateStore.begin(); itr != CreatureTemplateStore.end(); ++itr) - { CheckCreatureTemplate(&itr->second); - } sLog->outString(">> Loaded %u creature definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); @@ -1426,15 +1414,6 @@ void ObjectMgr::LoadCreatures() return; } - // Build single time for check creature data - std::set<uint32> difficultyCreatures[MAX_DIFFICULTY - 1]; - - CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates(); - for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr) - for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1; ++diff) - if (itr->second.DifficultyEntry[diff]) - difficultyCreatures[diff].insert(itr->second.DifficultyEntry[diff]); - // Build single time for check spawnmask std::map<uint32, uint32> spawnMasks; for (uint32 i = 0; i < sMapStore.GetNumRows(); ++i) @@ -1495,7 +1474,7 @@ void ObjectMgr::LoadCreatures() bool ok = true; for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff) { - if (difficultyCreatures[diff].find(data.id) != difficultyCreatures[diff].end()) + if (difficultyEntries[diff].find(data.id) != difficultyEntries[diff].end()) { sLog->outErrorDb("Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.", guid, diff + 1, data.id); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 89c13dd6b5c..d9e3d7ab823 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -102,9 +102,7 @@ uint32 LootStore::LoadLootTable() QueryResult result = WorldDatabase.PQuery("SELECT entry, item, ChanceOrQuestChance, lootmode, groupid, mincountOrRef, maxcount FROM %s", GetName()); if (!result) - { return 0; -} uint32 count = 0; |