mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
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:
parent
481c9c4e8d
commit
b3c6e763cd
2 changed files with 14 additions and 11 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue