]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
distinguish predicted / unpredicted local player
authorRudolf Polzer <divverent@xonotic.org>
Sun, 13 Nov 2011 15:30:09 +0000 (16:30 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 13 Nov 2011 15:30:09 +0000 (16:30 +0100)
qcsrc/common/csqcplayer.qc

index 95e50f3ea2dab02663431587d39d349ed9740090..d99da071dd7c1d87fd88b6a5168bbce98527b42c 100644 (file)
@@ -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();