aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellMgr.cpp
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2012-03-27 21:36:16 +0100
committerNay <dnpd.dd@gmail.com>2012-03-27 21:36:16 +0100
commit729f419af10f3fbac0d77319f7244bfbe2a443c0 (patch)
tree39a0fd6477ca22f5961bc7a83294f8c150a872ee /src/server/game/Spells/SpellMgr.cpp
parent8e87fe27443213ca3c312cf8078a44403542aa75 (diff)
Core/DBLayer: Correct few more wrong read types (No. 4)
DB/World: Some consistency in the ints "length" field (not really a length) All world dbs checked
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 7bfb71d83d4..965f27a6456 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1163,7 +1163,7 @@ void SpellMgr::LoadSpellRanks()
mSpellInfoMap[itr->first]->ChainEntry = NULL;
}
mSpellChains.clear();
-
+ // 0 1 2
QueryResult result = WorldDatabase.Query("SELECT first_spell_id, spell_id, rank from spell_ranks ORDER BY first_spell_id, rank");
if (!result)
@@ -1276,6 +1276,7 @@ void SpellMgr::LoadSpellRequired()
mSpellsReqSpell.clear(); // need for reload case
mSpellReq.clear(); // need for reload case
+ // 0 1
QueryResult result = WorldDatabase.Query("SELECT spell_id, req_spell from spell_required");
if (!result)
@@ -1386,10 +1387,10 @@ void SpellMgr::LoadSpellLearnSpells()
{
Field* fields = result->Fetch();
- uint32 spell_id = fields[0].GetUInt32();
+ uint32 spell_id = fields[0].GetUInt16();
SpellLearnSpellNode node;
- node.spell = fields[1].GetUInt32();
+ node.spell = fields[1].GetUInt16();
node.active = fields[2].GetBool();
node.autoLearned= false;
@@ -1475,7 +1476,7 @@ void SpellMgr::LoadSpellTargetPositions()
mSpellTargetPositions.clear(); // need for reload case
- // 0 1 2 3 4 5
+ // 0 1 2 3 4 5
QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position");
if (!result)
{
@@ -1494,7 +1495,7 @@ void SpellMgr::LoadSpellTargetPositions()
SpellTargetPosition st;
- st.target_mapId = fields[1].GetUInt32();
+ st.target_mapId = fields[1].GetUInt16();
st.target_X = fields[2].GetFloat();
st.target_Y = fields[3].GetFloat();
st.target_Z = fields[4].GetFloat();
@@ -1599,7 +1600,7 @@ void SpellMgr::LoadSpellGroups()
uint32 count = 0;
- // 0 1
+ // 0 1
QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group");
if (!result)
{
@@ -1696,7 +1697,7 @@ void SpellMgr::LoadSpellGroupStackRules()
Field* fields = result->Fetch();
uint32 group_id = fields[0].GetUInt32();
- uint8 stack_rule = fields[1].GetUInt32();
+ uint8 stack_rule = fields[1].GetInt8();
if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX)
{
sLog->outErrorDb("SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule);
@@ -1753,8 +1754,8 @@ void SpellMgr::LoadSpellProcEvents()
SpellProcEventEntry spe;
- spe.schoolMask = fields[1].GetUInt32();
- spe.spellFamilyName = fields[2].GetUInt32();
+ spe.schoolMask = fields[1].GetInt8();
+ spe.spellFamilyName = fields[2].GetUInt16();
spe.spellFamilyMask[0] = fields[3].GetUInt32();
spe.spellFamilyMask[1] = fields[4].GetUInt32();
spe.spellFamilyMask[2] = fields[5].GetUInt32();
@@ -1793,7 +1794,7 @@ void SpellMgr::LoadSpellProcs()
uint32 count = 0;
- // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
if (!result)
{
@@ -1833,8 +1834,8 @@ void SpellMgr::LoadSpellProcs()
SpellProcEntry baseProcEntry;
- baseProcEntry.schoolMask = fields[1].GetUInt32();
- baseProcEntry.spellFamilyName = fields[2].GetUInt32();
+ baseProcEntry.schoolMask = fields[1].GetInt8();
+ baseProcEntry.spellFamilyName = fields[2].GetUInt16();
baseProcEntry.spellFamilyMask[0] = fields[3].GetUInt32();
baseProcEntry.spellFamilyMask[1] = fields[4].GetUInt32();
baseProcEntry.spellFamilyMask[2] = fields[5].GetUInt32();
@@ -1997,7 +1998,7 @@ void SpellMgr::LoadSpellThreats()
}
SpellThreatEntry ste;
- ste.flatMod = fields[1].GetInt16();
+ ste.flatMod = fields[1].GetInt32();
ste.pctMod = fields[2].GetFloat();
ste.apPctMod = fields[3].GetFloat();
@@ -2204,7 +2205,7 @@ void SpellMgr::LoadSpellLinked()
int32 trigger = fields[0].GetInt32();
int32 effect = fields[1].GetInt32();
- int32 type = fields[2].GetInt32();
+ int32 type = fields[2].GetUInt8();
SpellInfo const* spellInfo = GetSpellInfo(abs(trigger));
if (!spellInfo)