aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/shared/baseachievement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mp/src/game/shared/baseachievement.cpp')
-rw-r--r--mp/src/game/shared/baseachievement.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/mp/src/game/shared/baseachievement.cpp b/mp/src/game/shared/baseachievement.cpp
index 494133c1..ebc5876e 100644
--- a/mp/src/game/shared/baseachievement.cpp
+++ b/mp/src/game/shared/baseachievement.cpp
@@ -427,13 +427,7 @@ void CBaseAchievement::EnsureComponentBitSetAndEvaluate( int iBitNumber )
// new component, set the bit and increment the count
SetComponentBits( m_iComponentBits | iBitMask );
- Assert( m_iCount <= m_iGoal );
- if ( m_iCount == m_iGoal )
- {
- // all components found, award the achievement (and save state)
- AwardAchievement();
- }
- else
+ if ( m_iCount != m_iGoal )
{
// save our state at the next good opportunity
m_pAchievementMgr->SetDirty( true );
@@ -453,6 +447,15 @@ void CBaseAchievement::EnsureComponentBitSetAndEvaluate( int iBitNumber )
Msg( "Component %d for achievement %s found, but already had that component\n", iBitNumber, GetName() );
}
}
+
+ // Check to see if we've achieved our goal even if the bit is already set
+ // (this fixes some older achievements that are stuck in the 9/9 state and could never be evaluated)
+ Assert( m_iCount <= m_iGoal );
+ if ( m_iCount == m_iGoal )
+ {
+ // all components found, award the achievement (and save state)
+ AwardAchievement();
+ }
}
//-----------------------------------------------------------------------------