From 5a249ac7c3d2a8ff16e665b8d87f1ac081ffdf37 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 8 May 2003 22:17:22 +0000 Subject: [PATCH] fix assert fail due to rounding error --- stepmania/src/PlayerAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stepmania/src/PlayerAI.cpp b/stepmania/src/PlayerAI.cpp index 98480f6902..3708f7c255 100644 --- a/stepmania/src/PlayerAI.cpp +++ b/stepmania/src/PlayerAI.cpp @@ -29,7 +29,7 @@ struct TapScoreDistribution for( int i=0; i<=TNS_MARVELOUS; i++ ) { fCumulativePercent += fPercent[i]; - if( fRand <= fCumulativePercent ) + if( fRand <= fCumulativePercent+1e-4 ) /* rounding error */ return (TapNoteScore)i; } ASSERT(0); // the fCumulativePercents must sum to 1.0, so we should never get here!