great-vault: write WeeklyRewardsPeriodSinceOrigin (was never set)
This commit is contained in:
@@ -162,6 +162,7 @@
|
|||||||
#include "PreyMgr.h"
|
#include "PreyMgr.h"
|
||||||
#include "OmniumFolioMgr.h"
|
#include "OmniumFolioMgr.h"
|
||||||
#include "CovenantPackets.h"
|
#include "CovenantPackets.h"
|
||||||
|
#include "WeeklyRewardsMgr.h"
|
||||||
//WowCommunity
|
//WowCommunity
|
||||||
|
|
||||||
// corpse reclaim times
|
// corpse reclaim times
|
||||||
@@ -25615,6 +25616,12 @@ void Player::SendInitialPacketsBeforeAddToMap()
|
|||||||
initialSetup.ServerExpansionLevel = sWorld->getIntConfig(CONFIG_EXPANSION);
|
initialSetup.ServerExpansionLevel = sWorld->getIntConfig(CONFIG_EXPANSION);
|
||||||
SendDirectMessage(initialSetup.Write());
|
SendDirectMessage(initialSetup.Write());
|
||||||
|
|
||||||
|
//WowCommunity
|
||||||
|
// Publish the current weekly-reward period so the client's vault UI and, crucially,
|
||||||
|
// ModifierTreeType::PlayerHasWeeklyRewardsAvailable (which fails while the field is 0) are correct.
|
||||||
|
UpdateWeeklyRewardsPeriod();
|
||||||
|
//WowCommunity
|
||||||
|
|
||||||
SetMovedUnit(this);
|
SetMovedUnit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35227,3 +35234,13 @@ void Player::RemoveSoulbindTraitSpells()
|
|||||||
RemoveAurasDueToSpell(spellId);
|
RemoveAurasDueToSpell(spellId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::UpdateWeeklyRewardsPeriod()
|
||||||
|
{
|
||||||
|
// WeeklyRewardsPeriodSinceOrigin is the week index the client uses to gate the Great Vault UI and
|
||||||
|
// ModifierTreeType::PlayerHasWeeklyRewardsAvailable (313), which returns false while the field is 0.
|
||||||
|
// It was never written, so that modifier always failed. Mirror the exact value the vault system
|
||||||
|
// uses (WeeklyRewardsMgr::GetCurrentPeriod) so the field and the vault roll over together.
|
||||||
|
SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::WeeklyRewardsPeriodSinceOrigin),
|
||||||
|
WeeklyRewardsMgr::GetCurrentPeriod());
|
||||||
|
}
|
||||||
|
|||||||
@@ -1849,6 +1849,10 @@ class TC_GAME_API Player final : public Unit, public GridObject<Player>
|
|||||||
void ResetMonthlyQuestStatus();
|
void ResetMonthlyQuestStatus();
|
||||||
void ResetSeasonalQuestStatus(uint16 event_id, time_t eventStartTime);
|
void ResetSeasonalQuestStatus(uint16 event_id, time_t eventStartTime);
|
||||||
|
|
||||||
|
//WowCommunity
|
||||||
|
void UpdateWeeklyRewardsPeriod();
|
||||||
|
//WowCommunity
|
||||||
|
|
||||||
uint16 FindQuestSlot(uint32 quest_id) const;
|
uint16 FindQuestSlot(uint32 quest_id) const;
|
||||||
uint32 GetQuestSlotQuestId(uint16 slot) const;
|
uint32 GetQuestSlotQuestId(uint16 slot) const;
|
||||||
uint32 GetQuestSlotState(uint16 slot) const;
|
uint32 GetQuestSlotState(uint16 slot) const;
|
||||||
|
|||||||
@@ -3329,7 +3329,12 @@ void World::ResetWeeklyQuests()
|
|||||||
// reset all quest status in memory
|
// reset all quest status in memory
|
||||||
for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||||
if (Player* player = itr->second->GetPlayer())
|
if (Player* player = itr->second->GetPlayer())
|
||||||
|
{
|
||||||
player->ResetWeeklyQuestStatus();
|
player->ResetWeeklyQuestStatus();
|
||||||
|
// Roll the client's weekly-reward period for players online across the reset so the vault
|
||||||
|
// UI / PlayerHasWeeklyRewardsAvailable stay correct without a relog.
|
||||||
|
player->UpdateWeeklyRewardsPeriod();
|
||||||
|
}
|
||||||
|
|
||||||
//WowCommunity
|
//WowCommunity
|
||||||
// Reset account-wide weekly Delves progress (weeklyCompletions / highest-this-week / bountiful / coffer shards).
|
// Reset account-wide weekly Delves progress (weeklyCompletions / highest-this-week / bountiful / coffer shards).
|
||||||
|
|||||||
Reference in New Issue
Block a user