diff --git a/engine/client/cl_cmds.c b/engine/client/cl_cmds.c index f767c772..540bdab5 100644 --- a/engine/client/cl_cmds.c +++ b/engine/client/cl_cmds.c @@ -136,10 +136,13 @@ void CL_PlayCDTrack_f( void ) } else if( !Q_stricmp( command, "info" )) { - int i, maxTrack; + int maxTrack = 0; - for( maxTrack = i = 0; i < MAX_CDTRACKS; i++ ) - if( COM_CheckStringEmpty( clgame.cdtracks[i] ) ) maxTrack++; + for( int i = 0; i < MAX_CDTRACKS; i++ ) + { + if( !COM_StringEmpty( clgame.cdtracks[i] ) ) + maxTrack++; + } Con_Printf( "%u tracks\n", maxTrack ); if( track ) diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index cf245236..0a8a0d25 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -2738,7 +2738,7 @@ static const char *pfnGetLevelName( void ) // a1ba: don't return maps/.bsp if no map is loaded yet // in GoldSrc this is handled by cl.levelname field but we don't have it // so emulate this behavior here - if( cls.state >= ca_connected && COM_CheckStringEmpty( clgame.mapname )) + if( cls.state >= ca_connected && !COM_StringEmpty( clgame.mapname )) Q_snprintf( mapname, sizeof( mapname ), "maps/%s.bsp", clgame.mapname ); else mapname[0] = '\0'; // not in game diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 6e7a1ef7..7f7e7a70 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -2372,7 +2372,7 @@ static void CL_Print( const char *c, const char *args, netadr_t from, sizebuf_t s = c[0] == A2C_GOLDSRC_PRINT ? args + 1 : MSG_ReadString( msg ); - if( !COM_CheckStringEmpty( s )) + if( COM_StringEmpty( s )) return; Con_Printf( "Remote message from %s:\n", NET_AdrToString( from )); @@ -3325,7 +3325,7 @@ static void CL_ListMessages_f( void ) Con_Printf( "num size name\n" ); for( i = 0; i < MAX_USER_MESSAGES; i++ ) { - if( !COM_CheckStringEmpty( clgame.msg[i].name )) + if( COM_StringEmpty( clgame.msg[i].name )) break; Con_Printf( "%3d\t%3d\t%s\n", clgame.msg[i].number, clgame.msg[i].size, clgame.msg[i].name ); diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index c15a0117..6b1cdfbb 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -858,7 +858,7 @@ void CL_ParseServerData( sizebuf_t *msg, connprotocol_t proto ) COM_StripExtension( clgame.mapname ); s = MSG_ReadString( msg ); - if( COM_CheckStringEmpty( s )) + if( !COM_StringEmpty( s )) Con_Printf( "Server map cycle: %s\n", s ); // VALVEWHY? if( MSG_ReadByte( msg )) @@ -1413,7 +1413,7 @@ void CL_UpdateUserinfo( sizebuf_t *msg, connprotocol_t proto ) player->spectator = Q_atoi( Info_ValueForKey( player->userinfo, "*hltv" )); MSG_ReadBytes( msg, player->hashedcdkey, sizeof( player->hashedcdkey )); - if( proto == PROTO_GOLDSRC && ( !COM_CheckStringEmpty( player->userinfo ) || !COM_CheckStringEmpty( player->name ))) + if( proto == PROTO_GOLDSRC && ( COM_StringEmpty( player->userinfo ) || COM_StringEmpty( player->name ))) active = false; if( active && slot == cl.playernum ) diff --git a/engine/client/cl_parse_gs.c b/engine/client/cl_parse_gs.c index 60bc294d..3b7c1a69 100644 --- a/engine/client/cl_parse_gs.c +++ b/engine/client/cl_parse_gs.c @@ -28,7 +28,7 @@ static void CL_ParseExtraInfo( sizebuf_t *msg ) string clientfallback; Q_strncpy( clientfallback, MSG_ReadString( msg ), sizeof( clientfallback )); - if( COM_CheckStringEmpty( clientfallback )) + if( !COM_StringEmpty( clientfallback )) Con_Reportf( S_ERROR "%s: TODO: add fallback directory %s!\n", __func__, clientfallback ); cls.allow_cheats = MSG_ReadByte( msg ) ? true : false; @@ -589,7 +589,7 @@ void CL_ParseGoldSrcServerMessage( sizebuf_t *msg ) break; case svc_disconnect: s = MSG_ReadString( msg ); - if( COM_CheckStringEmpty( s )) + if( !COM_StringEmpty( s )) Con_Printf( "Server issued disconnect. Reason: %s\n", s ); CL_Drop (); Host_AbortCurrentFrame (); diff --git a/engine/client/soundlib/snd_main.c b/engine/client/soundlib/snd_main.c index 57761ae0..2f7dd58c 100644 --- a/engine/client/soundlib/snd_main.c +++ b/engine/client/soundlib/snd_main.c @@ -64,7 +64,7 @@ wavdata_t *FS_LoadSound( const char *filename, const byte *buffer, size_t size ) Sound_Reset(); // clear old sounddata Q_strncpy( loadname, filename, sizeof( loadname )); - if( COM_CheckStringEmpty( ext )) + if( !COM_StringEmpty( ext )) { // we needs to compare file extension with list of supported formats // and be sure what is real extension, not a filename with dot @@ -168,7 +168,7 @@ stream_t *FS_OpenStream( const char *filename ) Sound_Reset(); // clear old streaminfo Q_strncpy( loadname, filename, sizeof( loadname )); - if( COM_CheckStringEmpty( ext )) + if( !COM_StringEmpty( ext )) { // we needs to compare file extension with list of supported formats // and be sure what is real extension, not a filename with dot