]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cmd.h
cbuf: recycle node after it executes, clear commands on Host_Error()
[xonotic/darkplaces.git] / cmd.h
diff --git a/cmd.h b/cmd.h
index c80fdf9078307f31f2f0afe5f9715af6fad25170..b3502919ab766fb74a1ac6989e72f7bea130e2a3 100644 (file)
--- a/cmd.h
+++ b/cmd.h
@@ -59,8 +59,9 @@ struct cmd_state_s;
 #define CF_PRIVATE              (1<<11) // cvar should not be $ expanded or sent to the server under any circumstances (rcon_password, etc)
 #define CF_MAXFLAGSVAL          ((1<<12) - 1)    // used to determine if flags is valid
 // for internal use only!
+#define CF_REGISTERED (1<<29)  // created by Cvar_RegisterVariable()
 #define CF_DEFAULTSET (1<<30)
-#define CF_ALLOCATED (1<<31)
+#define CF_ALLOCATED (1<<31)   // created by Cvar_Get() (console or QC)
 
 #define CF_SHARED 3
 
@@ -90,6 +91,7 @@ typedef struct cmd_function_s
        const char *description;
        xcommand_t function;
        qbool qcfunc;
+       struct cmd_function_s *overridden; // the engine cmd overriden by this QC cmd, if applicable
        qbool autofunc;
        qbool initstate; // indicates this command existed at init
 } cmd_function_t;
@@ -156,7 +158,7 @@ typedef struct cmd_input_s
 {
        llist_t list;
        cmd_state_t *source;
-       double delay;
+       vec_t delay;
        size_t size;
        size_t length;
        char *text;
@@ -197,6 +199,8 @@ void Cbuf_InsertText (cmd_state_t *cmd, const char *text);
 void Cbuf_Execute (cmd_buf_t *cbuf);
 /*! Performs deferred commands and runs Cbuf_Execute, called by Host_Frame */
 void Cbuf_Frame (cmd_buf_t *cbuf);
+/// Clears all command buffers
+void Cbuf_Clear(cmd_buf_t *cbuf);
 
 //===========================================================================