From ffaf9bcd3d749f9ffcaec08ff575fbcc9f275b26 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 13 Nov 2011 16:30:09 +0100 Subject: [PATCH] distinguish predicted / unpredicted local player --- qcsrc/common/csqcplayer.qc | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) 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(); -- 2.39.2