]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
fixed loadgame bug with edict references to later edicts (d was pointing at the old...
[xonotic/darkplaces.git] / cl_input.c
index f92087c56fe9843c5d5c38cdff6a97e735ac90a6..680632c75a2a354aae828dd6568682621e7e6b3b 100644 (file)
@@ -246,6 +246,7 @@ cvar_t cl_pitchspeed = {CVAR_SAVE, "cl_pitchspeed","150"};
 
 cvar_t cl_anglespeedkey = {CVAR_SAVE, "cl_anglespeedkey","1.5"};
 
+cvar_t cl_nodelta = {0, "cl_nodelta", "0"};
 
 /*
 ================
@@ -365,7 +366,7 @@ void CL_SendMove(usercmd_t *cmd)
        upmove += cmd->upmove;
        total++;
        // LordHavoc: cap outgoing movement messages to sys_ticrate
-       if ((cl.maxclients > 1) && (realtime - lastmovetime < sys_ticrate.value))
+       if (!cl.islocalgame && (realtime - lastmovetime < sys_ticrate.value))
                return;
        lastmovetime = realtime;
        // average what has happened during this time
@@ -391,7 +392,7 @@ void CL_SendMove(usercmd_t *cmd)
                for (i = 0;i < 3;i++)
                        MSG_WriteFloat (&buf, cl.viewangles[i]);
        }
-       else if (dpprotocol == DPPROTOCOL_VERSION1)
+       else if (dpprotocol == DPPROTOCOL_VERSION1 || dpprotocol == DPPROTOCOL_VERSION4)
        {
                for (i=0 ; i<3 ; i++)
                        MSG_WritePreciseAngle (&buf, cl.viewangles[i]);
@@ -430,12 +431,26 @@ void CL_SendMove(usercmd_t *cmd)
        MSG_WriteByte (&buf, in_impulse);
        in_impulse = 0;
 
-       // LordHavoc: should we ack this on receipt instead?  would waste net bandwidth though
-       i = EntityFrame_MostRecentlyRecievedFrameNum(&cl.entitydatabase);
-       if (i > 0)
+       if (dpprotocol == DPPROTOCOL_VERSION1 || dpprotocol == DPPROTOCOL_VERSION2 || dpprotocol == DPPROTOCOL_VERSION3)
        {
-               MSG_WriteByte(&buf, clc_ackentities);
-               MSG_WriteLong(&buf, i);
+               // LordHavoc: should we ack this on receipt instead?  would waste net bandwidth though
+               i = EntityFrame_MostRecentlyRecievedFrameNum(&cl.entitydatabase);
+               if (i > 0)
+               {
+                       MSG_WriteByte(&buf, clc_ackentities);
+                       MSG_WriteLong(&buf, i);
+               }
+       }
+       else
+       {
+               if (cl.entitydatabase4)
+               {
+                       MSG_WriteByte(&buf, clc_ackentities);
+                       if (cl_nodelta.integer)
+                               MSG_WriteLong(&buf, -1);
+                       else
+                               MSG_WriteLong(&buf, cl.entitydatabase4->ackframenum);
+               }
        }
 
        // deliver the message
@@ -509,5 +524,7 @@ void CL_InitInput (void)
        Cmd_AddCommand ("-button7", IN_Button7Up);
        Cmd_AddCommand ("+button8", IN_Button8Down);
        Cmd_AddCommand ("-button8", IN_Button8Up);
+
+       Cvar_RegisterVariable(&cl_nodelta);
 }