engine: common: cmd: add Cbuf_AddTextf wrapper

This commit is contained in:
Alibek Omarov 2023-03-13 05:28:53 +03:00
parent 6b62f9c1b9
commit b12b2aaf79
2 changed files with 13 additions and 0 deletions

View File

@ -120,6 +120,18 @@ void Cbuf_AddText( const char *text )
Cbuf_AddTextToBuffer( &cmd_text, text );
}
void Cbuf_AddTextf( const char *fmt, ... )
{
va_list va;
char buf[MAX_VA_STRING];
va_start( va, fmt );
Q_vsnprintf( buf, sizeof( buf ), fmt, va );
va_end( va );
Cbuf_AddText( buf );
}
/*
============
Cbuf_AddFilteredText

View File

@ -425,6 +425,7 @@ void FS_Shutdown( void );
void Cbuf_Init( void );
void Cbuf_Clear( void );
void Cbuf_AddText( const char *text );
void Cbuf_AddTextf( const char *text, ... ) _format( 1 );
void Cbuf_AddFilteredText( const char *text );
void Cbuf_InsertText( const char *text );
void Cbuf_ExecStuffCmds( void );