Core/Player: Quests with status QUEST_STATUS_NONE(0) shouldn't be loaded into player's queststatus storage. These should be removed since they are remnants from the old queststatus storage system.

This commit is contained in:
Machiavelli
2012-03-01 14:22:17 +01:00
parent b939ea5951
commit a36a0a77ef
2 changed files with 10 additions and 2 deletions

View File

@@ -0,0 +1 @@
DELETE FROM `character_queststatus` WHERE `status`=0;

View File

@@ -17781,12 +17781,19 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
QuestStatusData& questStatusData = m_QuestStatus[quest_id];
uint8 qstatus = fields[1].GetUInt8();
if (qstatus < MAX_QUEST_STATUS)
if (qstatus < MAX_QUEST_STATUS && qstatus > QUEST_STATUS_NONE)
questStatusData.Status = QuestStatus(qstatus);
else if (qstatus == QUEST_STATUS_NONE)
{
sLog->outError("Player %s (GUID: %u) has QUEST_STATUS_NONE for quest %u and should be removed from character_queststatus.",
GetName(), GetGUIDLow(), quest_id);
continue;
}
else
{
questStatusData.Status = QUEST_STATUS_INCOMPLETE;
sLog->outError("Player %s have invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).", GetName(), quest_id, qstatus);
sLog->outError("Player %s (GUID: %u) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).",
GetName(), GetGUIDLow(), quest_id, qstatus);
}
questStatusData.Explored = (fields[2].GetUInt8() > 0);