diff options
author | megamage <none@none> | 2009-02-09 20:09:03 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-09 20:09:03 -0600 |
commit | b8d4c243590c0d1d45e4f53c2605b0cd9cf710f0 (patch) | |
tree | c98729128188987e99f84ca8afbbcc7d0dbf9d0c /src/game/ObjectMgr.cpp | |
parent | 91356d97d5adc42ff5096386a5339983d335c689 (diff) |
[7248] Check `battlemaster_entry` data at loading. Code cleanups. Author: zhenya
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r-- | src/game/ObjectMgr.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 0c9ebcd19b8..e898112a75d 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -46,6 +46,7 @@ #include "Util.h" #include "WaypointManager.h" #include "InstanceData.h" //for condition_instance_data +#include "BattleGround.h" INSTANTIATE_SINGLETON_1(ObjectMgr); @@ -6749,6 +6750,11 @@ void ObjectMgr::LoadBattleMastersEntry() uint32 entry = fields[0].GetUInt32(); uint32 bgTypeId = fields[1].GetUInt32(); + if (bgTypeId >= MAX_BATTLEGROUND_TYPE_ID) + { + sLog.outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.",entry,bgTypeId); + continue; + } mBattleMastersMap[entry] = bgTypeId; @@ -7501,16 +7507,16 @@ void ObjectMgr::LoadTrainerSpell() TrainerSpell* pTrainerSpell = new TrainerSpell(); pTrainerSpell->spell = spell; - pTrainerSpell->spellcost = fields[2].GetUInt32(); - pTrainerSpell->reqskill = fields[3].GetUInt32(); - pTrainerSpell->reqskillvalue = fields[4].GetUInt32(); - pTrainerSpell->reqlevel = fields[5].GetUInt32(); + pTrainerSpell->spellCost = fields[2].GetUInt32(); + pTrainerSpell->reqSkill = fields[3].GetUInt32(); + pTrainerSpell->reqSkillValue = fields[4].GetUInt32(); + pTrainerSpell->reqLevel = fields[5].GetUInt32(); - if(!pTrainerSpell->reqlevel) - pTrainerSpell->reqlevel = spellinfo->spellLevel; + if(!pTrainerSpell->reqLevel) + pTrainerSpell->reqLevel = spellinfo->spellLevel; // calculate learned spell for profession case when stored cast-spell - pTrainerSpell->learned_spell = spell; + pTrainerSpell->learnedSpell = spell; for(int i = 0; i <3; ++i) { if(spellinfo->Effect[i]!=SPELL_EFFECT_LEARN_SPELL) @@ -7518,7 +7524,7 @@ void ObjectMgr::LoadTrainerSpell() if(SpellMgr::IsProfessionOrRidingSpell(spellinfo->EffectTriggerSpell[i])) { - pTrainerSpell->learned_spell = spellinfo->EffectTriggerSpell[i]; + pTrainerSpell->learnedSpell = spellinfo->EffectTriggerSpell[i]; break; } } |