2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2025-01-10 10:25:37 +01:00

engine: convert Cbuf_AddText with va to Cbuf_AddTextf

This commit is contained in:
Alibek Omarov 2023-03-13 05:31:27 +03:00
parent b12b2aaf79
commit d667845777
10 changed files with 13 additions and 13 deletions

View File

@ -838,7 +838,7 @@ send client connect
*/ */
static void GAME_EXPORT pfnClientJoin( const netadr_t adr ) static void GAME_EXPORT pfnClientJoin( const netadr_t adr )
{ {
Cbuf_AddText( va( "connect %s\n", NET_AdrToString( adr ))); Cbuf_AddTextf( "connect %s\n", NET_AdrToString( adr ));
} }
/* /*

View File

@ -2086,7 +2086,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
if( NET_CompareAdr( from, cls.legacyserver )) if( NET_CompareAdr( from, cls.legacyserver ))
{ {
Cbuf_AddText( va( "connect %s legacy\n", NET_AdrToString( from ))); Cbuf_AddTextf( "connect %s legacy\n", NET_AdrToString( from ));
memset( &cls.legacyserver, 0, sizeof( cls.legacyserver )); memset( &cls.legacyserver, 0, sizeof( cls.legacyserver ));
} }
} }

View File

@ -2001,7 +2001,7 @@ void CL_ParseExec( sizebuf_t *msg )
COM_FileBase( clgame.mapname, mapname ); COM_FileBase( clgame.mapname, mapname );
if ( COM_CheckString( mapname ) ) if ( COM_CheckString( mapname ) )
Cbuf_AddText( va( "exec %s.cfg\n", mapname ) ); Cbuf_AddTextf( "exec %s.cfg\n", mapname );
} }
} }

View File

@ -737,7 +737,7 @@ static void Touch_ReloadConfig_f( void )
touch.edit = touch.selection = NULL; touch.edit = touch.selection = NULL;
touch.resize_finger = touch.move_finger = touch.look_finger = touch.wheel_finger = -1; touch.resize_finger = touch.move_finger = touch.look_finger = touch.wheel_finger = -1;
Cbuf_AddText( va("exec %s\n", touch_config_file->string ) ); Cbuf_AddTextf( "exec %s\n", touch_config_file->string );
} }
static touch_button_t *Touch_AddButton( touchbuttonlist_t *list, static touch_button_t *Touch_AddButton( touchbuttonlist_t *list,
@ -1111,7 +1111,7 @@ static void Touch_InitConfig( void )
//pfnGetScreenInfo( NULL ); //HACK: update hud screen parameters like iHeight //pfnGetScreenInfo( NULL ); //HACK: update hud screen parameters like iHeight
if( FS_FileExists( touch_config_file->string, true ) ) if( FS_FileExists( touch_config_file->string, true ) )
{ {
Cbuf_AddText( va( "exec \"%s\"\n", touch_config_file->string ) ); Cbuf_AddTextf( "exec \"%s\"\n", touch_config_file->string );
Cbuf_Execute(); Cbuf_Execute();
} }
else else

View File

@ -224,7 +224,7 @@ static qboolean R_DoResetGamma( void )
static qboolean R_Init_Video_( const int type ) static qboolean R_Init_Video_( const int type )
{ {
host.apply_opengl_config = true; host.apply_opengl_config = true;
Cbuf_AddText( va( "exec %s.cfg", ref.dllFuncs.R_GetConfigName())); Cbuf_AddTextf( "exec %s.cfg", ref.dllFuncs.R_GetConfigName());
Cbuf_Execute(); Cbuf_Execute();
host.apply_opengl_config = false; host.apply_opengl_config = false;

View File

@ -827,7 +827,7 @@ void Host_Userconfigd_f( void )
for( i = 0; i < t->numfilenames; i++ ) for( i = 0; i < t->numfilenames; i++ )
{ {
Cbuf_AddText( va("exec %s\n", t->filenames[i] ) ); Cbuf_AddTextf( "exec %s\n", t->filenames[i] );
} }
Mem_Free( t ); Mem_Free( t );
@ -1221,7 +1221,7 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
Wcon_ShowConsole( false ); // hide console Wcon_ShowConsole( false ); // hide console
#endif #endif
// execute startup config and cmdline // execute startup config and cmdline
Cbuf_AddText( va( "exec %s.rc\n", SI.rcName )); Cbuf_AddTextf( "exec %s.rc\n", SI.rcName );
Cbuf_Execute(); Cbuf_Execute();
if( !host.config_executed ) if( !host.config_executed )
{ {
@ -1255,7 +1255,7 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
// execute server.cfg after commandline // execute server.cfg after commandline
// so we have a chance to set servercfgfile // so we have a chance to set servercfgfile
Cbuf_AddText( va( "exec %s\n", Cvar_VariableString( "servercfgfile" ))); Cbuf_AddTextf( "exec %s\n", Cvar_VariableString( "servercfgfile" ));
Cbuf_Execute(); Cbuf_Execute();
} }

View File

@ -394,7 +394,7 @@ void SV_HazardCourse_f( void )
// special case for Gunman Chronicles: playing avi-file // special case for Gunman Chronicles: playing avi-file
if( FS_FileExists( va( "media/%s.avi", GI->trainmap ), false )) if( FS_FileExists( va( "media/%s.avi", GI->trainmap ), false ))
{ {
Cbuf_AddText( va( "wait; movie %s\n", GI->trainmap )); Cbuf_AddTextf( "wait; movie %s\n", GI->trainmap );
Host_EndGame( true, DEFAULT_ENDGAME_MESSAGE ); Host_EndGame( true, DEFAULT_ENDGAME_MESSAGE );
} }
else COM_NewGame( GI->trainmap ); else COM_NewGame( GI->trainmap );

View File

@ -159,7 +159,7 @@ static void SV_BanID_f( void )
cidfilter = filter; cidfilter = filter;
if( cl && !Q_stricmp( Cmd_Argv( Cmd_Argc() - 1 ), "kick" )) if( cl && !Q_stricmp( Cmd_Argv( Cmd_Argc() - 1 ), "kick" ))
Cbuf_AddText( va( "kick #%d \"Kicked and banned\"\n", cl->userid )); Cbuf_AddTextf( "kick #%d \"Kicked and banned\"\n", cl->userid );
} }
static void SV_ListID_f( void ) static void SV_ListID_f( void )

View File

@ -628,7 +628,7 @@ void SV_ActivateServer( int runPhysics )
const char *cycle = Cvar_VariableString( "mapchangecfgfile" ); const char *cycle = Cvar_VariableString( "mapchangecfgfile" );
if( COM_CheckString( cycle )) if( COM_CheckString( cycle ))
Cbuf_AddText( va( "exec %s\n", cycle )); Cbuf_AddTextf( "exec %s\n", cycle );
} }
} }

View File

@ -1739,7 +1739,7 @@ static qboolean SaveGameSlot( const char *pSaveName, const char *pSaveComment )
} }
// pending the preview image for savegame // pending the preview image for savegame
Cbuf_AddText( va( "saveshot \"%s\"\n", pSaveName )); Cbuf_AddTextf( "saveshot \"%s\"\n", pSaveName );
Con_Printf( "Saving game to %s...\n", name ); Con_Printf( "Saving game to %s...\n", name );
version = SAVEGAME_VERSION; version = SAVEGAME_VERSION;