]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_cmd.c
cmd: Reimplement console buffer system as a cyclic doubly linked list
[xonotic/darkplaces.git] / cl_cmd.c
index b6e6e8c05b3b67c14b5133b5e74c153e05958350..e8f90268951fdc6f5876493a0ff87f7cf6f27b33 100644 (file)
--- a/cl_cmd.c
+++ b/cl_cmd.c
@@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "image.h"
 #include <time.h>
 
+#include "cl_collision.h"
+
 cvar_t cl_name = {CVAR_CLIENT | CVAR_SAVE | CVAR_USERINFO, "name", "player", "change your player name"};
 cvar_t cl_rate = {CVAR_CLIENT | CVAR_SAVE | CVAR_USERINFO, "rate", "20000", "change your connection speed"};
 cvar_t cl_rate_burstsize = {CVAR_CLIENT | CVAR_SAVE | CVAR_USERINFO, "rate_burstsize", "1024", "internal storage cvar for current rate control burst size (changed by rate_burstsize command)"};
@@ -182,7 +184,8 @@ void CL_ForwardToServer_f (cmd_state_t *cmd)
                // we need to keep the command name, so send Cmd_Argv(cmd, 0), a space and then Cmd_Args(cmd)
                i = dpsnprintf(vabuf, sizeof(vabuf), "%s", Cmd_Argv(cmd, 0));
                if(Cmd_Argc(cmd) > 1)
-                       dpsnprintf(&vabuf[i], sizeof(vabuf - i), " %s", Cmd_Args(cmd));
+                       // (i + 1) accounts for the added space
+                       dpsnprintf(&vabuf[i], sizeof(vabuf) - (i + 1), " %s", Cmd_Args(cmd));
                s = vabuf;
        }
        // don't send an empty forward message if the user tries "cmd" by itself
@@ -218,7 +221,7 @@ static void CL_SendCvar_f(cmd_state_t *cmd)
 CL_Color_f
 ==================
 */
-cvar_t cl_color = {CVAR_READONLY | CVAR_CLIENT | CVAR_SAVE, "_cl_color", "0", "internal storage cvar for current player colors (changed by color command)"};
+cvar_t cl_color = {CVAR_CLIENT | CVAR_SAVE, "_cl_color", "0", "internal storage cvar for current player colors (changed by color command)"};
 
 // Ignore the callbacks so this two-to-three way synchronization doesn't cause an infinite loop.
 static void CL_Color_c(cvar_t *var)