allow cbufs to have a callback for unknown commands. if the callback

returns non-zero the unknown command is assumed to have been handled and no
error is reported
This commit is contained in:
Bill Currie 2003-11-20 07:02:14 +00:00
parent 481c9c4e8d
commit b3c6e763cd
2 changed files with 14 additions and 11 deletions

View file

@ -60,6 +60,7 @@ typedef struct cbuf_s {
CBUF_STATE_JUNK // Buffer can be freed or reused
} state;
int (*unknown_command)(void); // handle unkown commands. !0 = handled
qboolean strict; // Should we tolerate unknown commands?
double resumetime; // Time when stack can be executed again

View file

@ -128,6 +128,8 @@ Cmd_Command (cbuf_args_t *args)
// check cvars
if (Cvar_Command ())
return 0;
if (cbuf_active->unknown_command && cbuf_active->unknown_command ())
return 0;
if (cbuf_active->strict)
return -1;
else if (cmd_warncmd->int_val || developer->int_val)