From c4683bdf38ee666c9e1125f7e64ffda581d296ae Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 6 Oct 2026 00:40:25 +0200 Subject: [PATCH] Fix achievement unlock propagation. Achieve() now propagates a category unlock to the category's remaining items, matching the constructor's load-time behavior. This lets an achievement complete in the session where its category first unlocks. --- profiler/src/profiler/TracyAchievements.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/profiler/src/profiler/TracyAchievements.cpp b/profiler/src/profiler/TracyAchievements.cpp index ee814336..32c1093c 100644 --- a/profiler/src/profiler/TracyAchievements.cpp +++ b/profiler/src/profiler/TracyAchievements.cpp @@ -126,7 +126,15 @@ void AchievementsMgr::Achieve( const char* id ) { (*c)->unlockTime = t; auto cit = m_map.find( (*c)->id ); - if( cit->second.category->unlockTime == 0 ) cit->second.category->unlockTime = t; + assert( cit != m_map.end() ); + auto& cat = *cit->second.category; + if( cat.unlockTime == 0 ) cat.unlockTime = t; + auto items = cat.items; + while( *items ) + { + if( (*items)->unlockTime == 0 ) (*items)->unlockTime = cat.unlockTime; + items++; + } c++; } }