+vector prediction_error;
+float prediction_errortime;
+float autocvar_cl_predictionerrorcompensation = 20;
+
+vector GetPredictionError()
+{
+ if(time < prediction_errortime)
+ return prediction_error * (prediction_errortime - time) * autocvar_cl_predictionerrorcompensation;
+ return '0 0 0';
+}
+
+void SetPredictionError(vector v)
+{
+ prediction_error = (prediction_errortime - time) * autocvar_cl_predictionerrorcompensation * prediction_error + v;
+ prediction_errortime = time + 1.0 / autocvar_cl_predictionerrorcompensation;
+}
+