mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-11 14:42:05 +08:00
engine: common: set cmd_args to "" when tokenising, if we've no arguments
Fixes metamod-fwgs[1] breaking when CMD_ARGS() returns NULL. [1]: https://github.com/FWGS/metamod-fwgs/blob/eedede40e806e7f3d1604de61ed43404928ea639/metamod/src/commands_meta.cpp#L63
This commit is contained in:
committed by
a1batross
parent
0daf2c2b4d
commit
95548053eb
+5
-2
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user