Core/DBLayer: Correct few more wrong read types (No. 1)

DB/World: Some consistency in the ints "length" field (not really a length)

From A to D world tables verified; missing all the others

int(11) -> int32
unsigned int(10) -> uint32
mediumint(8) -> int32
unsigned mediumint(8) -> uint32
smallint(6) -> int16
unsigned smallint(5) -> uint16
tinyint(4) -> int8
unsigned tinyint(3) -> uint8
This commit is contained in:
Nay
2012-03-27 00:43:56 +01:00
parent 8f365de4b2
commit a92820b51c
11 changed files with 95 additions and 46 deletions
+12 -12
View File
@@ -422,7 +422,7 @@ void ObjectMgr::LoadCreatureTemplates()
creatureTemplate.GossipMenuId = fields[13].GetUInt32();
creatureTemplate.minlevel = fields[14].GetUInt8();
creatureTemplate.maxlevel = fields[15].GetUInt8();
creatureTemplate.expansion = uint32(fields[16].GetUInt16());
creatureTemplate.expansion = uint32(fields[16].GetInt16());
creatureTemplate.faction_A = uint32(fields[17].GetUInt16());
creatureTemplate.faction_H = uint32(fields[18].GetUInt16());
creatureTemplate.npcflag = fields[19].GetUInt32();
@@ -455,7 +455,7 @@ 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();
creatureTemplate.resistance[i] = fields[47 + i -1].GetInt16();
for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
creatureTemplate.spells[i] = fields[53 + i].GetUInt32();
@@ -5975,7 +5975,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
AreaTrigger at;
at.target_mapId = fields[1].GetUInt32();
at.target_mapId = fields[1].GetUInt16();
at.target_X = fields[2].GetFloat();
at.target_Y = fields[3].GetFloat();
at.target_Z = fields[4].GetFloat();
@@ -6837,13 +6837,13 @@ void ObjectMgr::LoadReputationOnKill()
uint32 creature_id = fields[0].GetUInt32();
ReputationOnKillEntry repOnKill;
repOnKill.RepFaction1 = fields[1].GetUInt32();
repOnKill.RepFaction2 = fields[2].GetUInt32();
repOnKill.RepFaction1 = fields[1].GetInt16();
repOnKill.RepFaction2 = fields[2].GetInt16();
repOnKill.IsTeamAward1 = fields[3].GetBool();
repOnKill.ReputationMaxCap1 = fields[4].GetUInt32();
repOnKill.ReputationMaxCap1 = fields[4].GetUInt8();
repOnKill.RepValue1 = fields[5].GetInt32();
repOnKill.IsTeamAward2 = fields[6].GetBool();
repOnKill.ReputationMaxCap2 = fields[7].GetUInt32();
repOnKill.ReputationMaxCap2 = fields[7].GetUInt8();
repOnKill.RepValue2 = fields[8].GetInt32();
repOnKill.TeamDependent = fields[9].GetUInt8();
@@ -8692,16 +8692,16 @@ void ObjectMgr::LoadCreatureClassLevelStats()
{
Field* fields = result->Fetch();
uint8 Level = fields[0].GetUInt8();
uint8 Class = fields[1].GetUInt8();
uint8 Level = fields[0].GetInt8();
uint8 Class = fields[1].GetInt8();
CreatureBaseStats stats;
for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i)
stats.BaseHealth[i] = fields[i + 2].GetUInt16();
stats.BaseHealth[i] = fields[i + 2].GetInt16();
stats.BaseMana = fields[5].GetUInt16();
stats.BaseArmor = fields[6].GetUInt16();
stats.BaseMana = fields[5].GetInt16();
stats.BaseArmor = fields[6].GetInt16();
if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0)
sLog->outErrorDb("Creature base stats for level %u has invalid class %u", Level, Class);