]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
properly input velocity to V_CalcRefdef
authorRudolf Polzer <divverent@alientrap.org>
Mon, 9 Jan 2012 12:23:01 +0000 (13:23 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 9 Jan 2012 12:23:01 +0000 (13:23 +0100)
qcsrc/csqcmodellib/cl_player.qc

index 71fc2f600cd44af355f7ba015ba67165abe8b9fc..2de165226c97dc0279f657e88c72439d12ef23b8 100644 (file)
@@ -138,6 +138,9 @@ void(entity e, float fl) V_CalcRefdef = #640; // DP_CSQC_V_CALCREFDEF
 
 void CSQCPlayer_SetCamera()
 {
+       vector v0;
+       v0 = pmove_vel; // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity
+
        if(csqcplayer)
        {
                entity oldself;
@@ -169,6 +172,9 @@ void CSQCPlayer_SetCamera()
 
                        // override it back just in case
                        self.view_ofs = '0 0 1' * getstati(STAT_VIEWHEIGHT);
+
+                       // set velocity
+                       self.velocity = v0;
                }
                else
                {
@@ -176,12 +182,11 @@ void CSQCPlayer_SetCamera()
                        {
                                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;
+                               self.velocity = v0;
 
                                // get crouch state from the server
                                if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)