From: Rudolf Polzer Date: Sun, 13 Nov 2011 15:30:09 +0000 (+0100) Subject: distinguish predicted / unpredicted local player X-Git-Tag: xonotic-v0.6.0~74^2~100^2~91 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ffaf9bcd3d749f9ffcaec08ff575fbcc9f275b26;p=xonotic%2Fxonotic-data.pk3dir.git distinguish predicted / unpredicted local player --- diff --git a/qcsrc/common/csqcplayer.qc b/qcsrc/common/csqcplayer.qc index 95e50f3ea..d99da071d 100644 --- a/qcsrc/common/csqcplayer.qc +++ b/qcsrc/common/csqcplayer.qc @@ -87,20 +87,27 @@ void CSQCPlayer_SetCamera() oldself = self; self = csqcplayer; - if(csqcplayer_status == CSQCPLAYERSTATUS_FROMSERVER) + if(servercommandframe == 0) { - vector o, v; - o = self.origin; - v = pmove_vel; // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity - csqcplayer_status = CSQCPLAYERSTATUS_PREDICTED; - CSQCPlayer_PredictTo(servercommandframe + 1); - CSQCPlayer_SetPredictionError(o - self.origin); - self.origin = o; - self.velocity = v; - CSQCPlayer_SavePrediction(); + InterpolateOrigin_Do(); + } + else + { + if(csqcplayer_status == CSQCPLAYERSTATUS_FROMSERVER) + { + vector o, v; + o = self.origin; + v = pmove_vel; // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity + csqcplayer_status = CSQCPLAYERSTATUS_PREDICTED; + CSQCPlayer_PredictTo(servercommandframe + 1); + CSQCPlayer_SetPredictionError(o - self.origin); + self.origin = o; + self.velocity = v; + CSQCPlayer_SavePrediction(); + } + CSQCPlayer_PredictTo(clientcommandframe); } - CSQCPlayer_PredictTo(clientcommandframe); self = oldself; org = csqcplayer.origin + csqcplayer.view_ofs + CSQCPlayer_GetPredictionError();