+ break;
+
+ case 7:
+ /* bones_was_here: this aims to prevent disturbances in the force from affecting cl.time
+ * the rolling harmonic mean gives large time error outliers low significance
+ * correction rate is dynamic and gradual (max 10% of mean error per tic)
+ * time is correct within a few server frames of connect/map start
+ * can achieve microsecond accuracy when cl.realframetime is a multiple of sv.frametime
+ * prevents 0ms move frame times with uncapped fps
+ * smoothest mode esp. for vsynced clients on servers with aggressive inputtimeout
+ */
+ {
+ unsigned char i;
+ float error;
+ // in event of packet loss, cl.mtime[1] could be very old, so avoid if possible
+ double target = cl.movevars_ticrate ? cl.mtime[0] - cl.movevars_ticrate : cl.mtime[1];
+ cl.ts_error_stor[cl.ts_error_num] = 1.0f / max(fabs(cl.time - target), FLT_MIN);
+ cl.ts_error_num = (cl.ts_error_num + 1) % NUM_TS_ERRORS;
+ for (i = 0, error = 0.0f; i < NUM_TS_ERRORS; i++)
+ error += cl.ts_error_stor[i];
+ error = 0.1f / (error / NUM_TS_ERRORS);
+ cl.time = bound(cl.time - error, target, cl.time + error);
+ }
+ break;