From 73fdbf1319e4e7461d22c4576d919907138f4072 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 24 Apr 2007 19:31:32 +0000 Subject: [PATCH] clamp --- stepmania/src/PercentageDisplay.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stepmania/src/PercentageDisplay.cpp b/stepmania/src/PercentageDisplay.cpp index fdf4c9c6d1..d84fd48015 100644 --- a/stepmania/src/PercentageDisplay.cpp +++ b/stepmania/src/PercentageDisplay.cpp @@ -191,6 +191,8 @@ void PercentageDisplay::Refresh() RString PercentageDisplay::FormatPercentScore( float fPercentDancePoints ) { + CLAMP( fPercentDancePoints, 0.f, 1.f ); + // TRICKY: printf will round, but we want to truncate. Otherwise, we may display a percent // score that's too high and doesn't match up with the calculated grade. float fTruncInterval = powf( 0.1f, (float)PERCENT_TOTAL_SIZE-1 );