Watch out for NaN, etc. That assert will never trigger unless PCRE stops working (or someone breaks the regex).

This commit is contained in:
Steve Checkoway
2006-06-12 07:56:27 +00:00
parent 3f27205e40
commit 2992fa865a
+3 -3
View File
@@ -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<RString> 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;