From: Rudolf Polzer Date: Mon, 16 Jan 2012 14:09:43 +0000 (+0100) Subject: invert the sense in which prediction error is stored; document the cvar X-Git-Tag: xonotic-v0.6.0~157^2~4 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=2367634d814025a77a95afd6557774a0f90a8396 invert the sense in which prediction error is stored; document the cvar --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 52c14b2be9..b664245201 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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" diff --git a/qcsrc/csqcmodellib/cl_player.qc b/qcsrc/csqcmodellib/cl_player.qc index a08bfca7d3..a11b3962b2 100644 --- a/qcsrc/csqcmodellib/cl_player.qc +++ b/qcsrc/csqcmodellib/cl_player.qc @@ -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;