mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
Core/Players: Fixed saving quest item progress (#1129)
Ported from TC (original commit by Shauren) Add 2 columns to character_queststatus
This commit is contained in:
@@ -18975,8 +18975,8 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
|
||||
|
||||
//// 0 1 2 3 4 5 6 7 8 9 10
|
||||
//QueryResult* result = CharacterDatabase.PQuery("SELECT quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3,
|
||||
// 11 12
|
||||
// itemcount4, playercount FROM character_queststatus WHERE guid = '%u'", GetGUIDLow());
|
||||
// 11 12 13 14
|
||||
// itemcount4, itemcount5, itemcount6, playercount FROM character_queststatus WHERE guid = '%u'", GetGUIDLow());
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -19018,15 +19018,13 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
|
||||
else
|
||||
quest_time = 0;
|
||||
|
||||
questStatusData.CreatureOrGOCount[0] = fields[4].GetUInt16();
|
||||
questStatusData.CreatureOrGOCount[1] = fields[5].GetUInt16();
|
||||
questStatusData.CreatureOrGOCount[2] = fields[6].GetUInt16();
|
||||
questStatusData.CreatureOrGOCount[3] = fields[7].GetUInt16();
|
||||
questStatusData.ItemCount[0] = fields[8].GetUInt16();
|
||||
questStatusData.ItemCount[1] = fields[9].GetUInt16();
|
||||
questStatusData.ItemCount[2] = fields[10].GetUInt16();
|
||||
questStatusData.ItemCount[3] = fields[11].GetUInt16();
|
||||
questStatusData.PlayerCount = fields[12].GetUInt16();
|
||||
for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
questStatusData.CreatureOrGOCount[i] = fields[4 + i].GetUInt16();
|
||||
|
||||
for (uint32 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
questStatusData.ItemCount[i] = fields[8 + i].GetUInt16();
|
||||
|
||||
questStatusData.PlayerCount = fields[14].GetUInt16();
|
||||
|
||||
// add to quest log
|
||||
if (slot < MAX_QUEST_LOG_SIZE && questStatusData.Status != QUEST_STATUS_NONE)
|
||||
@@ -19952,10 +19950,10 @@ void Player::_SaveQuestStatus(SQLTransaction& trans)
|
||||
stmt->setBool(index++, statusItr->second.Explored);
|
||||
stmt->setUInt32(index++, uint32(statusItr->second.Timer / IN_MILLISECONDS+ sWorld->GetGameTime()));
|
||||
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
stmt->setUInt16(index++, statusItr->second.CreatureOrGOCount[i]);
|
||||
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
|
||||
stmt->setUInt16(index++, statusItr->second.ItemCount[i]);
|
||||
|
||||
stmt->setUInt16(index, statusItr->second.PlayerCount);
|
||||
|
||||
Reference in New Issue
Block a user