From 2992fa865a7fbe0045e873b3a3f53bc9227ffc9f Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Mon, 12 Jun 2006 07:56:27 +0000 Subject: [PATCH] Watch out for NaN, etc. That assert will never trigger unless PCRE stops working (or someone breaks the regex). --- stepmania/src/PlayerOptions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stepmania/src/PlayerOptions.cpp b/stepmania/src/PlayerOptions.cpp index 914d07a1de..663eab4391 100644 --- a/stepmania/src/PlayerOptions.cpp +++ b/stepmania/src/PlayerOptions.cpp @@ -257,6 +257,8 @@ void PlayerOptions::FromString( const RString &sOptions, bool bWarnOnInvalid ) else if( *s[0]=='*' ) { sscanf( *s, "*%f", &speed ); + if( !isfinite(speed) ) + speed = 1.0f; } } @@ -270,9 +272,7 @@ void PlayerOptions::FromString( const RString &sOptions, bool bWarnOnInvalid ) vector matches; if( mult.Compare(sBit, matches) ) { - char *p = NULL; - level = strtof( matches[0], &p ); - ASSERT( p != matches[0] ); + ::FromString( matches[0], level ); SET_FLOAT( fScrollSpeed ) SET_FLOAT( fTimeSpacing ) m_fTimeSpacing = 0;