aboutsummaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp1
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp26
-rwxr-xr-xsrc/server/game/Movement/Waypoints/WaypointManager.cpp1
-rwxr-xr-xsrc/server/game/Scripting/ScriptSystem.cpp10
-rwxr-xr-xsrc/server/game/Skills/SkillDiscovery.cpp2
-rwxr-xr-xsrc/server/game/Skills/SkillExtraItems.cpp2
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp29
7 files changed, 38 insertions, 33 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 776ffd78a9a..e3264adc310 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -198,7 +198,6 @@ void SmartAIMgr::LoadSmartAIFromDB()
temp.event.raw.param4 = fields[11].GetUInt32();
temp.action.type = (SMART_ACTION)fields[12].GetUInt8();
-
temp.action.raw.param1 = fields[13].GetUInt32();
temp.action.raw.param2 = fields[14].GetUInt32();
temp.action.raw.param3 = fields[15].GetUInt32();
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 63a02378787..2a92a437d72 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2804,6 +2804,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
uint32 count = 0;
+ // 0 1 2 3 4 5
QueryResult result = WorldDatabase.Query("SELECT `entry`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_template_accessory`");
if (!result)
@@ -2860,6 +2861,7 @@ void ObjectMgr::LoadVehicleAccessories()
uint32 count = 0;
+ // 0 1 2 3 4 5
QueryResult result = WorldDatabase.Query("SELECT `guid`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_accessory`");
if (!result)
@@ -6753,7 +6755,7 @@ void ObjectMgr::LoadReputationRewardRate()
_repRewardRateStore.clear(); // for reload case
- uint32 count = 0;
+ uint32 count = 0; // 0 1 2 3
QueryResult result = WorldDatabase.Query("SELECT faction, quest_rate, creature_rate, spell_rate FROM reputation_reward_rate");
if (!result)
@@ -6890,7 +6892,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
_repSpilloverTemplateStore.clear(); // for reload case
- uint32 count = 0;
+ uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12
QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template");
if (!result)
@@ -6904,22 +6906,22 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
{
Field* fields = result->Fetch();
- uint32 factionId = fields[0].GetUInt32();
+ uint32 factionId = fields[0].GetUInt16();
RepSpilloverTemplate repTemplate;
- repTemplate.faction[0] = fields[1].GetUInt32();
+ repTemplate.faction[0] = fields[1].GetUInt16();
repTemplate.faction_rate[0] = fields[2].GetFloat();
- repTemplate.faction_rank[0] = fields[3].GetUInt32();
- repTemplate.faction[1] = fields[4].GetUInt32();
+ repTemplate.faction_rank[0] = fields[3].GetUInt8();
+ repTemplate.faction[1] = fields[4].GetUInt16();
repTemplate.faction_rate[1] = fields[5].GetFloat();
- repTemplate.faction_rank[1] = fields[6].GetUInt32();
- repTemplate.faction[2] = fields[7].GetUInt32();
+ repTemplate.faction_rank[1] = fields[6].GetUInt8();
+ repTemplate.faction[2] = fields[7].GetUInt16();
repTemplate.faction_rate[2] = fields[8].GetFloat();
- repTemplate.faction_rank[2] = fields[9].GetUInt32();
- repTemplate.faction[3] = fields[10].GetUInt32();
+ repTemplate.faction_rank[2] = fields[9].GetUInt8();
+ repTemplate.faction[3] = fields[10].GetUInt16();
repTemplate.faction_rate[3] = fields[11].GetFloat();
- repTemplate.faction_rank[3] = fields[12].GetUInt32();
+ repTemplate.faction_rank[3] = fields[12].GetUInt8();
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
@@ -7806,7 +7808,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
{
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
- int32 skill = fields[1].GetInt32();
+ int32 skill = fields[1].GetInt16();
AreaTableEntry const* fArea = GetAreaEntryByAreaID(entry);
if (!fArea)
diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp
index 2c3a58f55a3..93d9e2290c1 100755
--- a/src/server/game/Movement/Waypoints/WaypointManager.cpp
+++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp
@@ -43,6 +43,7 @@ void WaypointMgr::Load()
{
uint32 oldMSTime = getMSTime();
+ // 0 1 2 3 4 5 6 7 8 9
QueryResult result = WorldDatabase.Query("SELECT id, point, position_x, position_y, position_z, orientation, move_flag, delay, action, action_chance FROM waypoint_data ORDER BY id, point");
if (!result)
diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index 66f5a4089dc..c38d559372f 100755
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -30,7 +30,8 @@ void SystemMgr::LoadScriptTexts()
sLog->outString("TSCR: Loading Script Texts additional data...");
uint32 oldMSTime = getMSTime();
-
+
+ // 0 1 2 3
QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts");
if (!result)
@@ -49,9 +50,9 @@ void SystemMgr::LoadScriptTexts()
int32 iId = pFields[0].GetInt32();
temp.uiSoundId = pFields[1].GetUInt32();
- temp.uiType = pFields[2].GetUInt32();
- temp.uiLanguage = pFields[3].GetUInt32();
- temp.uiEmote = pFields[4].GetUInt32();
+ temp.uiType = pFields[2].GetUInt8();
+ temp.uiLanguage = pFields[3].GetUInt8();
+ temp.uiEmote = pFields[4].GetUInt16();
if (iId >= 0)
{
@@ -164,6 +165,7 @@ void SystemMgr::LoadScriptWaypoints()
sLog->outString("TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount);
+ // 0 1 2 3 4 5
result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid");
if (!result)
diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp
index 3ece4b57741..e314fab07be 100755
--- a/src/server/game/Skills/SkillDiscovery.cpp
+++ b/src/server/game/Skills/SkillDiscovery.cpp
@@ -71,7 +71,7 @@ void LoadSkillDiscoveryTable()
uint32 spellId = fields[0].GetUInt32();
int32 reqSkillOrSpell = fields[1].GetInt32();
- uint32 reqSkillValue = fields[2].GetUInt32();
+ uint32 reqSkillValue = fields[2].GetUInt16();
float chance = fields[3].GetFloat();
if (chance <= 0) // chance
diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp
index c68e3cdcfe0..3bb435145f1 100755
--- a/src/server/game/Skills/SkillExtraItems.cpp
+++ b/src/server/game/Skills/SkillExtraItems.cpp
@@ -55,7 +55,7 @@ void LoadSkillExtraItemTable()
SkillExtraItemStore.clear(); // need for reload
- // 0 1 2 3
+ // 0 1 2 3
QueryResult result = WorldDatabase.Query("SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template");
if (!result)
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)