diff options
author | Spp <none@none> | 2010-03-10 08:58:22 +0100 |
---|---|---|
committer | Spp <none@none> | 2010-03-10 08:58:22 +0100 |
commit | b957b2736b2fa9f86b9a3fa312c60dd08de0cd7b (patch) | |
tree | 3d5db3203f59522a526bb04dba0e5d2c30fe4b14 /src | |
parent | 7fd1789109b1203fcc4c477012abacf4e1ed2b81 (diff) |
Fix crash in group loading.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Group.cpp | 16 | ||||
-rw-r--r-- | src/game/ObjectMgr.cpp | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/game/Group.cpp b/src/game/Group.cpp index 1e35411fa13..4fac78bf63f 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -132,7 +132,7 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult_AutoPtr result if(!result) { external = false; - // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 result = CharacterDatabase.PQuery("SELECT lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, raiddifficulty FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(leaderGuid)); if(!result) return false; @@ -144,27 +144,27 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult_AutoPtr result if(!objmgr.GetPlayerNameByGUID(m_leaderGuid, m_leaderName)) return false; - m_groupType = (*result)[13].GetBool() ? GROUPTYPE_RAID : GROUPTYPE_NORMAL; + m_groupType = (*result)[11].GetBool() ? GROUPTYPE_RAID : GROUPTYPE_NORMAL; if (m_groupType == GROUPTYPE_RAID) _initRaidSubGroupsCounter(); - uint32 diff = (*result)[14].GetUInt8(); + uint32 diff = (*result)[12].GetUInt8(); if (diff >= MAX_DUNGEON_DIFFICULTY) diff = DUNGEON_DIFFICULTY_NORMAL; m_dungeonDifficulty = Difficulty(diff); - uint32 r_diff = (*result)[15].GetUInt8(); + uint32 r_diff = (*result)[13].GetUInt8(); if (r_diff >= MAX_RAID_DIFFICULTY) r_diff = RAID_DIFFICULTY_10MAN_NORMAL; m_raidDifficulty = Difficulty(r_diff); - m_lootMethod = (LootMethod)(*result)[2].GetUInt8(); - m_looterGuid = MAKE_NEW_GUID((*result)[3].GetUInt32(), 0, HIGHGUID_PLAYER); - m_lootThreshold = (ItemQualities)(*result)[4].GetUInt16(); + m_lootMethod = (LootMethod)(*result)[0].GetUInt8(); + m_looterGuid = MAKE_NEW_GUID((*result)[1].GetUInt32(), 0, HIGHGUID_PLAYER); + m_lootThreshold = (ItemQualities)(*result)[2].GetUInt16(); for (int i=0; i<TARGETICONCOUNT; ++i) - m_targetIcons[i] = (*result)[5+i].GetUInt64(); + m_targetIcons[i] = (*result)[3+i].GetUInt64(); if(loadMembers) { diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 93da45ae611..a26ea9d80b1 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -3364,7 +3364,7 @@ void ObjectMgr::LoadGroups() Group *group = NULL; uint64 leaderGuid = 0; uint32 count = 0; - // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, raiddifficulty, leaderGuid FROM groups"); if( !result ) @@ -3385,7 +3385,7 @@ void ObjectMgr::LoadGroups() bar.step(); Field *fields = result->Fetch(); ++count; - leaderGuid = MAKE_NEW_GUID(fields[16].GetUInt32(),0,HIGHGUID_PLAYER); + leaderGuid = MAKE_NEW_GUID(fields[14].GetUInt32(),0,HIGHGUID_PLAYER); group = new Group; if(!group->LoadGroupFromDB(leaderGuid, result, false)) |