From d58234a6c7475ea57ab5783dd0a0dd6ca5e54583 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 7 Jun 2017 19:04:32 -0500 Subject: [PATCH] Fix 'missing token' in parsers for animations.cfg --- code/cgame/cg_players.c | 16 ++++++++-------- code/q3_ui/ui_players.c | 16 ++++++++-------- code/ui/ui_players.c | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/code/cgame/cg_players.c b/code/cgame/cg_players.c index 9c76aac3..500c63be 100644 --- a/code/cgame/cg_players.c +++ b/code/cgame/cg_players.c @@ -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 ); diff --git a/code/q3_ui/ui_players.c b/code/q3_ui/ui_players.c index d8794cbb..b40ec90f 100644 --- a/code/q3_ui/ui_players.c +++ b/code/q3_ui/ui_players.c @@ -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 ); diff --git a/code/ui/ui_players.c b/code/ui/ui_players.c index 53475d31..87812ef3 100644 --- a/code/ui/ui_players.c +++ b/code/ui/ui_players.c @@ -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 );