void Cmd_ExecuteString (const char *text, cmd_source_t src)
{
int oldpos;
+ int found;
cmd_function_t *cmd;
cmdalias_t *a;
oldpos = cmd_tokenizebufferpos;
cmd_source = src;
+ found = false;
Cmd_TokenizeString (text);
}
else
Con_Printf("Command \"%s\" can not be executed\n", Cmd_Argv(0));
- cmd_tokenizebufferpos = oldpos;
- return;
+ found = true;
+ goto command_found;
+ break;
case src_client:
if (cmd->clientfunction)
{
break;
}
}
+command_found:
// if it's a client command and no command was found, say so.
if (cmd_source == src_client)
{
Con_Printf("player \"%s\" tried to %s\n", host_client->name, text);
+ cmd_tokenizebufferpos = oldpos;
return;
}
}
}
+ if(found) // if the command was hooked and found, all is good
+ {
+ cmd_tokenizebufferpos = oldpos;
+ return;
+ }
+
// check cvars
if (!Cvar_Command () && host_framecount > 0)
Con_Printf("Unknown command \"%s\"\n", Cmd_Argv(0));