mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-23 01:00:54 +00:00
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.
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user