]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
invert the sense in which prediction error is stored; document the cvar
authorRudolf Polzer <divverent@alientrap.org>
Mon, 16 Jan 2012 14:09:43 +0000 (15:09 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 16 Jan 2012 14:09:43 +0000 (15:09 +0100)
defaultXonotic.cfg
qcsrc/csqcmodellib/cl_player.qc

index 52c14b2be90d9f41000144d0ad6a9060b27e3e35..b6642452010bfbfe513027d966206d399ddcefb5 100644 (file)
@@ -1776,6 +1776,7 @@ seta cl_forceplayercolors 0 "make everyone look like your own color (requires se
 seta cl_forcemyplayermodel "" "set to the model file name you want to show yourself as (requires server to have sv_use_csqc_players 1; does not affect how enemies look with cl_forceplayermodels)"
 seta cl_forcemyplayerskin 0 "set to the skin number you want to show yourself as (requires server to have sv_use_csqc_players 1; does not affect how enemies look with cl_forceplayermodels)"
 seta cl_forcemyplayercolors 0 "set to the color value (encoding is same as _cl_color) for your own player model (requires server to have sv_use_csqc_players 1, and is ignored in teamplay; does not affect how enemies look with cl_forceplayermodels)"
+seta cl_predictionerrorcompensation 0 "try to compensate for prediction errors and reduce preceived lag (requires server to have sv_use_csqc_players 1)"
 
 // debug cvars for keyhunt attaching
 set _angles "0 0 0"
index a08bfca7d3113c88004900e6d84ff0c9390c384e..a11b3962b26bb8fda38ca4d314f8cfe7d7cbae62 100644 (file)
@@ -116,8 +116,8 @@ void CSQCPlayer_PredictTo(float endframe, float apply_error)
        CSQCPlayer_Unpredict();
        if(apply_error)
        {
-               self.origin -= CSQCPlayer_GetPredictionErrorO();
-               self.velocity -= CSQCPlayer_GetPredictionErrorV();
+               self.origin += CSQCPlayer_GetPredictionErrorO();
+               self.velocity += CSQCPlayer_GetPredictionErrorV();
        }
        CSQCPlayer_SetMinsMaxs();
 
@@ -210,7 +210,7 @@ void CSQCPlayer_SetCamera()
                                v = v0;
                                csqcplayer_status = CSQCPLAYERSTATUS_PREDICTED;
                                CSQCPlayer_PredictTo(servercommandframe + 1, FALSE);
-                               CSQCPlayer_SetPredictionError(o - self.origin, v0 - self.velocity);
+                               CSQCPlayer_SetPredictionError(self.origin - o, self.velocity - v);
                                self.origin = o;
                                self.velocity = v;