engine: common: set cmd_args to "" when tokenising, if we've no arguments

Fixes metamod-fwgs[1] breaking when CMD_ARGS() returns NULL.

[1]: eedede40e8/metamod/src/commands_meta.cpp (L63)
This commit is contained in:
Zane van Iperen
2026-04-20 21:52:37 +10:00
committed by a1batross
parent 0daf2c2b4d
commit 95548053eb

View File

@@ -615,8 +615,11 @@ void Cmd_TokenizeString( const char *text )
if( !*text )
return;
if( cmd_argc == 1 )
cmd_args = text;
switch( cmd_argc )
{
case 0: cmd_args = ""; break;
case 1: cmd_args = text; break;
}
text = COM_ParseFileSafe( (char*)text, cmd_token, sizeof( cmd_token ), PFILE_IGNOREBRACKET, NULL, NULL );