engine: client: replace COM_CheckStringEmpty with COM_StringEmpty

This commit is contained in:
Alibek Omarov
2026-02-20 23:36:15 +05:00
committed by a1batross
parent ae15886a14
commit 24aaeb07cb
6 changed files with 15 additions and 12 deletions

View File

@@ -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 )

View File

@@ -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

View File

@@ -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 );

View File

@@ -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 )

View File

@@ -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 ();

View File

@@ -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