Core/DBLayer: Fix creature and spell_rank loading
This commit is contained in:
@@ -1426,8 +1426,8 @@ void ObjectMgr::LoadCreatures()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 guid = fields[ 0].GetUInt32();
|
||||
uint32 entry = fields[ 1].GetUInt32();
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
uint32 entry = fields[1].GetUInt32();
|
||||
|
||||
CreatureTemplate const* cInfo = GetCreatureTemplate(entry);
|
||||
if (!cInfo)
|
||||
@@ -1438,14 +1438,14 @@ void ObjectMgr::LoadCreatures()
|
||||
|
||||
CreatureData& data = _creatureDataStore[guid];
|
||||
data.id = entry;
|
||||
data.mapid = fields[ 2].GetUInt32();
|
||||
data.displayid = fields[ 3].GetUInt32();
|
||||
data.equipmentId = fields[ 4].GetUInt32();
|
||||
data.posX = fields[ 5].GetFloat();
|
||||
data.posY = fields[ 6].GetFloat();
|
||||
data.posZ = fields[ 7].GetFloat();
|
||||
data.orientation = fields[ 8].GetFloat();
|
||||
data.spawntimesecs = fields[ 9].GetUInt32();
|
||||
data.mapid = fields[2].GetUInt16();
|
||||
data.displayid = fields[3].GetUInt32();
|
||||
data.equipmentId = fields[4].GetInt32();
|
||||
data.posX = fields[5].GetFloat();
|
||||
data.posY = fields[6].GetFloat();
|
||||
data.posZ = fields[7].GetFloat();
|
||||
data.orientation = fields[8].GetFloat();
|
||||
data.spawntimesecs = fields[9].GetUInt32();
|
||||
data.spawndist = fields[10].GetFloat();
|
||||
data.currentwaypoint= fields[11].GetUInt32();
|
||||
data.curhealth = fields[12].GetUInt32();
|
||||
@@ -1453,7 +1453,7 @@ void ObjectMgr::LoadCreatures()
|
||||
data.movementType = fields[14].GetUInt8();
|
||||
data.spawnMask = fields[15].GetUInt8();
|
||||
data.phaseMask = fields[16].GetUInt16();
|
||||
int16 gameEvent = fields[17].GetInt16();
|
||||
int16 gameEvent = fields[17].GetInt8();
|
||||
uint32 PoolId = fields[18].GetUInt32();
|
||||
data.npcflag = fields[19].GetUInt32();
|
||||
data.unit_flags = fields[20].GetUInt32();
|
||||
@@ -1735,8 +1735,8 @@ void ObjectMgr::LoadGameobjects()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 guid = fields[ 0].GetUInt32();
|
||||
uint32 entry = fields[ 1].GetUInt32();
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
uint32 entry = fields[1].GetUInt32();
|
||||
|
||||
GameObjectTemplate const* gInfo = GetGameObjectTemplate(entry);
|
||||
if (!gInfo)
|
||||
@@ -1767,14 +1767,14 @@ void ObjectMgr::LoadGameobjects()
|
||||
GameObjectData& data = _gameObjectDataStore[guid];
|
||||
|
||||
data.id = entry;
|
||||
data.mapid = fields[ 2].GetUInt32();
|
||||
data.posX = fields[ 3].GetFloat();
|
||||
data.posY = fields[ 4].GetFloat();
|
||||
data.posZ = fields[ 5].GetFloat();
|
||||
data.orientation = fields[ 6].GetFloat();
|
||||
data.rotation0 = fields[ 7].GetFloat();
|
||||
data.rotation1 = fields[ 8].GetFloat();
|
||||
data.rotation2 = fields[ 9].GetFloat();
|
||||
data.mapid = fields[2].GetUInt32();
|
||||
data.posX = fields[3].GetFloat();
|
||||
data.posY = fields[4].GetFloat();
|
||||
data.posZ = fields[5].GetFloat();
|
||||
data.orientation = fields[6].GetFloat();
|
||||
data.rotation0 = fields[7].GetFloat();
|
||||
data.rotation1 = fields[8].GetFloat();
|
||||
data.rotation2 = fields[9].GetFloat();
|
||||
data.rotation3 = fields[10].GetFloat();
|
||||
data.spawntimesecs = fields[11].GetInt32();
|
||||
|
||||
@@ -8698,10 +8698,10 @@ void ObjectMgr::LoadCreatureClassLevelStats()
|
||||
CreatureBaseStats stats;
|
||||
|
||||
for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i)
|
||||
stats.BaseHealth[i] = fields[i + 2].GetUInt32();
|
||||
stats.BaseHealth[i] = fields[i + 2].GetUInt16();
|
||||
|
||||
stats.BaseMana = fields[5].GetUInt32();
|
||||
stats.BaseArmor = fields[6].GetUInt32();
|
||||
stats.BaseMana = fields[5].GetUInt16();
|
||||
stats.BaseArmor = fields[6].GetUInt16();
|
||||
|
||||
if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0)
|
||||
sLog->outErrorDb("Creature base stats for level %u has invalid class %u", Level, Class);
|
||||
|
||||
@@ -1193,7 +1193,7 @@ void SpellMgr::LoadSpellRanks()
|
||||
if (lastSpell == -1)
|
||||
lastSpell = currentSpell;
|
||||
uint32 spell_id = fields[1].GetUInt32();
|
||||
uint32 rank = fields[2].GetUInt32();
|
||||
uint32 rank = fields[2].GetUInt8();
|
||||
|
||||
// don't drop the row if we're moving to the next rank
|
||||
if (currentSpell == lastSpell)
|
||||
|
||||
Reference in New Issue
Block a user