From dbca4bbf7fb975409648f81a575f8297bf2f76f3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 14 Jan 2005 15:58:19 +0000 Subject: [PATCH] fix crashes due to big meter values --- stepmania/src/GameState.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index fd01e4501f..d4caf28828 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -296,7 +296,9 @@ void AddPlayerStatsToProfile( Profile *pProfile, const StageStats &ss, PlayerNum pProfile->m_iNumSongsPlayedByPlayMode[ss.playMode]++; pProfile->m_iNumSongsPlayedByStyle[sID] ++; pProfile->m_iNumSongsPlayedByDifficulty[pSteps->GetDifficulty()] ++; - pProfile->m_iNumSongsPlayedByMeter[pSteps->GetMeter()] ++; + + int iMeter = clamp( pSteps->GetMeter(), 0, MAX_METER ); + pProfile->m_iNumSongsPlayedByMeter[iMeter] ++; } pProfile->m_iTotalDancePoints += ss.m_player[pn].iActualDancePoints;