From 5faeed32e74386380b7c8045eac09c121bc0ced7 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 24 Feb 2004 02:14:31 +0000 Subject: [PATCH] validate grade input (so we don't crash later writing stats.html) --- stepmania/src/HighScore.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stepmania/src/HighScore.cpp b/stepmania/src/HighScore.cpp index 7184ce3887..b7c4b73537 100644 --- a/stepmania/src/HighScore.cpp +++ b/stepmania/src/HighScore.cpp @@ -68,6 +68,9 @@ void HighScore::LoadFromNode( const XNode* pNode ) else if( (*child)->name == "SurviveSeconds" ) (*child)->GetValue( fSurviveSeconds ); else if( (*child)->name == "Modifiers" ) (*child)->GetValue( sModifiers ); } + + /* Validate input. */ + grade = clamp( grade, GRADE_TIER_1, GRADE_FAILED ); }