Fix 'missing token' in parsers for animations.cfg

This commit is contained in:
Zack Middleton 2017-06-07 19:04:32 -05:00
parent 6e340f9a5b
commit d58234a6c7
3 changed files with 24 additions and 24 deletions

View file

@ -128,12 +128,12 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci )
while ( 1 ) {
prev = text_p; // so we can unget
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
if ( !Q_stricmp( token, "footsteps" ) ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
if ( !Q_stricmp( token, "default" ) || !Q_stricmp( token, "normal" ) ) {
@ -153,7 +153,7 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci )
} else if ( !Q_stricmp( token, "headoffset" ) ) {
for ( i = 0 ; i < 3 ; i++ ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
ci->headOffset[i] = atof( token );
@ -161,7 +161,7 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci )
continue;
} else if ( !Q_stricmp( token, "sex" ) ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
if ( token[0] == 'f' || token[0] == 'F' ) {
@ -192,7 +192,7 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci )
for ( i = 0 ; i < MAX_ANIMATIONS ; i++ ) {
token = COM_Parse( &text_p );
if ( !*token ) {
if ( !token[0] ) {
if( i >= TORSO_GETFLAG && i <= TORSO_NEGATIVE ) {
animations[i].firstFrame = animations[TORSO_GESTURE].firstFrame;
animations[i].frameLerp = animations[TORSO_GESTURE].frameLerp;
@ -215,7 +215,7 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci )
}
token = COM_Parse( &text_p );
if ( !*token ) {
if ( !token[0] ) {
break;
}
animations[i].numFrames = atoi( token );
@ -229,13 +229,13 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci )
}
token = COM_Parse( &text_p );
if ( !*token ) {
if ( !token[0] ) {
break;
}
animations[i].loopFrames = atoi( token );
token = COM_Parse( &text_p );
if ( !*token ) {
if ( !token[0] ) {
break;
}
fps = atof( token );

View file

@ -964,26 +964,26 @@ static qboolean UI_ParseAnimationFile( const char *filename, animation_t *animat
while ( 1 ) {
prev = text_p; // so we can unget
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
if ( !Q_stricmp( token, "footsteps" ) ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
continue;
} else if ( !Q_stricmp( token, "headoffset" ) ) {
for ( i = 0 ; i < 3 ; i++ ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
}
continue;
} else if ( !Q_stricmp( token, "sex" ) ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
continue;
@ -1002,7 +1002,7 @@ static qboolean UI_ParseAnimationFile( const char *filename, animation_t *animat
for ( i = 0 ; i < MAX_ANIMATIONS ; i++ ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
animations[i].firstFrame = atoi( token );
@ -1015,19 +1015,19 @@ static qboolean UI_ParseAnimationFile( const char *filename, animation_t *animat
}
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
animations[i].numFrames = atoi( token );
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
animations[i].loopFrames = atoi( token );
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
fps = atof( token );

View file

@ -1051,26 +1051,26 @@ static qboolean UI_ParseAnimationFile( const char *filename, animation_t *animat
while ( 1 ) {
prev = text_p; // so we can unget
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
if ( !Q_stricmp( token, "footsteps" ) ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
continue;
} else if ( !Q_stricmp( token, "headoffset" ) ) {
for ( i = 0 ; i < 3 ; i++ ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
}
continue;
} else if ( !Q_stricmp( token, "sex" ) ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
continue;
@ -1089,7 +1089,7 @@ static qboolean UI_ParseAnimationFile( const char *filename, animation_t *animat
for ( i = 0 ; i < MAX_ANIMATIONS ; i++ ) {
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
animations[i].firstFrame = atoi( token );
@ -1102,19 +1102,19 @@ static qboolean UI_ParseAnimationFile( const char *filename, animation_t *animat
}
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
animations[i].numFrames = atoi( token );
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
animations[i].loopFrames = atoi( token );
token = COM_Parse( &text_p );
if ( !token ) {
if ( !token[0] ) {
break;
}
fps = atof( token );