mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 12:47:07 +00:00
fix(Core/Player): Align SaveSeasonQuestStatus() with TrinityCore (#10503)
This commit is contained in:
@@ -85,7 +85,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS, "INSERT INTO character_queststatus_daily (guid, quest, time) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS, "INSERT INTO character_queststatus_weekly (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHARACTER_MONTHLYQUESTSTATUS, "INSERT INTO character_queststatus_monthly (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS, "INSERT INTO character_queststatus_seasonal (guid, quest, event) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS, "INSERT IGNORE INTO character_queststatus_seasonal (guid, quest, event) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_REPUTATION, "SELECT faction, standing, flags FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_INVENTORY, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, bag, slot, "
|
||||
"item, itemEntry FROM character_inventory ci JOIN item_instance ii ON ci.item = ii.guid WHERE ci.guid = ? ORDER BY bag, slot", CONNECTION_ASYNC);
|
||||
|
||||
@@ -7640,30 +7640,38 @@ void Player::_SaveWeeklyQuestStatus(CharacterDatabaseTransaction trans)
|
||||
|
||||
void Player::_SaveSeasonalQuestStatus(CharacterDatabaseTransaction trans)
|
||||
{
|
||||
if (!m_SeasonalQuestChanged || m_seasonalquests.empty())
|
||||
if (!m_SeasonalQuestChanged)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// we don't need transactions here.
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_SEASONAL_CHAR);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
m_SeasonalQuestChanged = false;
|
||||
|
||||
if (m_seasonalquests.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (SeasonalEventQuestMap::const_iterator iter = m_seasonalquests.begin(); iter != m_seasonalquests.end(); ++iter)
|
||||
{
|
||||
uint16 event_id = iter->first;
|
||||
uint16 eventId = iter->first;
|
||||
|
||||
for (SeasonalQuestSet::const_iterator itr = iter->second.begin(); itr != iter->second.end(); ++itr)
|
||||
{
|
||||
uint32 quest_id = (*itr);
|
||||
uint32 questId = *itr;
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, quest_id);
|
||||
stmt->setUInt32(2, event_id);
|
||||
stmt->setUInt32(1, questId);
|
||||
stmt->setUInt32(2, eventId);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
}
|
||||
|
||||
m_SeasonalQuestChanged = false;
|
||||
}
|
||||
|
||||
void Player::_SaveMonthlyQuestStatus(CharacterDatabaseTransaction trans)
|
||||
|
||||
Reference in New Issue
Block a user