fix bAllowNull not honored if StepsType_Invalid/Difficulty_Invalid

This commit is contained in:
Glenn Maynard
2007-08-12 22:24:24 +00:00
parent 4a409d387a
commit bda199bd88
+3 -4
View File
@@ -24,10 +24,9 @@ Trail *TrailID::ToTrail( const Course *p, bool bAllowNull ) const
{ {
ASSERT( p ); ASSERT( p );
if( st == StepsType_Invalid || cd == Difficulty_Invalid ) Trail *pRet = NULL;
return NULL; if( st != StepsType_Invalid && cd != Difficulty_Invalid )
pRet = p->GetTrail( st, cd );
Trail *pRet = p->GetTrail( st, cd );
if( !bAllowNull && pRet == NULL ) if( !bAllowNull && pRet == NULL )
RageException::Throw( "%i, %i, \"%s\"", st, cd, p->GetDisplayFullTitle().c_str() ); RageException::Throw( "%i, %i, \"%s\"", st, cd, p->GetDisplayFullTitle().c_str() );