]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_user.c
new menu QC builtin "stringwidth(string text, float handleColors)", does not do anyth...
[xonotic/darkplaces.git] / sv_user.c
index decd9e54cd25999535308dfb9463f7dbbec966fc..a2fb80d88ec9ed56ff56b617f64b510da20ef3dc 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -371,6 +371,8 @@ void SV_ClientThink (void)
 {
        vec3_t v_angle;
 
+       //Con_Printf("clientthink for %ims\n", (int) (sv.frametime * 1000));
+
        SV_ApplyClientMove();
        // make sure the velocity is sane (not a NaN)
        SV_CheckVelocity(host_client->edict);
@@ -579,6 +581,7 @@ void SV_ExecuteClientMoves(void)
                                Con_Printf("%smove #%i %ims (%ims) %i %i '%i %i %i' '%i %i %i'\n", (move->time - host_client->cmd.time) > sv.frametime * 1.01 ? "^1" : "^2", move->sequence, (int)floor((move->time - host_client->cmd.time) * 1000.0 + 0.5), (int)floor(move->time * 1000.0 + 0.5), move->impulse, move->buttons, (int)move->viewangles[0], (int)move->viewangles[1], (int)move->viewangles[2], (int)move->forwardmove, (int)move->sidemove, (int)move->upmove);
 #endif
                                // this is a new move
+                               move->time = max(move->time, host_client->cmd.time); // prevent backstepping of time
                                moveframetime = bound(0, move->time - host_client->cmd.time, 0.1);
                                //Con_Printf("movesequence = %i (%i lost), moveframetime = %f\n", move->sequence, move->sequence ? move->sequence - host_client->movesequence - 1 : 0, moveframetime);
                                host_client->cmd = *move;
@@ -626,6 +629,7 @@ void SV_ExecuteClientMoves(void)
                        }
                }
                // now copy the new move
+               sv_readmoves[sv_numreadmoves-1].time = max(sv_readmoves[sv_numreadmoves-1].time, host_client->cmd.time); // prevent backstepping of time
                host_client->cmd = sv_readmoves[sv_numreadmoves-1];
                host_client->movesequence = 0;
                // make sure that normal physics takes over immediately