From 9c5909ad155f483b31fb56c23b75f71cf9bfab4a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 08:45:13 +0000 Subject: [PATCH] Decompile fn_23916 (CSession::RefreshTrackedAchievement) Batch #15684 by youko: 0 byte-identical, 1 confirmed by peer review. - fn_23916 CSession::RefreshTrackedAchievement: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Yommy, alisonrag Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/ClientTiming.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Source/Contents/ClientTiming.cpp b/Source/Contents/ClientTiming.cpp index 146de4088..697ccf88e 100644 --- a/Source/Contents/ClientTiming.cpp +++ b/Source/Contents/ClientTiming.cpp @@ -586,35 +586,31 @@ void CSession::RefreshTrackedAchievement(int id) { return; } - auto record = g_session.achievements.find(id); - SessionRecord6144 progress = record != g_session.achievements.end() ? record->second : SessionRecord6144(); + SessionRecord6144 progress = g_session.FindAchievementRecord(id); AchievementInfo info; g_achievementMgr->GetAchievement(info, id); found->completed = reinterpret_cast(&progress.completionFlags)[1]; for (unsigned int i = 0; i < info.rewards.size(); ++i) { - const AchievementReward& reward = info.rewards[i]; - SessionRecord6178Entry& entry = found->objectives[i]; - if (info.progressMode == 0) { - if (reward.text.size() > 40) { - entry.text = static_cast(FormatOwnedString("- %s...", reward.text.substr(0, 40).c_str())); + if (info.rewards[i].text.size() > 40) { + found->objectives[i].text = static_cast(FormatOwnedString("- %s...", info.rewards[i].text.substr(0, 40).c_str())); } else { - entry.text = static_cast(FormatOwnedString("- %s", reward.text.c_str())); + found->objectives[i].text = static_cast(FormatOwnedString("- %s", info.rewards[i].text.c_str())); } - entry.completed = static_cast(progress.objectives[i]) > 0; + found->objectives[i].completed = static_cast(progress.objectives[i]) > 0; } else if (info.progressMode == 1) { int value = progress.objectives[i]; - std::string count = FormatOwnedString("(%d/%d)", value, reward.targetCount); - if (reward.text.size() + count.size() > 40) { - entry.text = static_cast(FormatOwnedString("- %s...%s", reward.text.substr(0, 40 - count.size()).c_str(), count.c_str())); + std::string count = FormatOwnedString("(%d/%d)", value, info.rewards[i].targetCount); + if (info.rewards[i].text.size() + count.size() > 40) { + found->objectives[i].text = static_cast(FormatOwnedString("- %s...%s", info.rewards[i].text.substr(0, 40 - count.size()).c_str(), count.c_str())); } else { - entry.text = static_cast(FormatOwnedString("- %s %s", reward.text.c_str(), count.c_str())); + found->objectives[i].text = static_cast(FormatOwnedString("- %s %s", info.rewards[i].text.c_str(), count.c_str())); } - entry.completed = value == reward.targetCount; + found->objectives[i].completed = value == info.rewards[i].targetCount; } } }