]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_physics.qc
Merge remote branch 'origin/master' into samual/flyingspectators
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index e2feca927b94472af9ff963e1c01d141be5d2d01..f0617740e654210a45af5754dc526b5aaef48625 100644 (file)
@@ -23,7 +23,7 @@ When you press the jump key
 */
 void PlayerJump (void)
 {
-       if(g_freezetag && self.freezetag_frozen)
+       if(self.freezetag_frozen)
                return; // no jumping in freezetag when frozen
 
        float mjumpheight;
@@ -61,7 +61,7 @@ void PlayerJump (void)
        if(!doublejump && self.multijump_ready && self.multijump_count < autocvar_g_multijump && self.velocity_z > autocvar_g_multijump_speed)
        {
                // doublejump = FALSE; // checked above in the if
-               if (autocvar_g_multijump > 0)
+               if (autocvar_g_multijump)
                {
                        if (autocvar_g_multijump_add == 0) // in this case we make the z velocity == jumpvelocity
                        {
@@ -93,7 +93,8 @@ void PlayerJump (void)
                                        self.velocity_y = wishdir_y * curspeed;
                                        // keep velocity_z unchanged!
                                }
-                               self.multijump_count += 1;
+                               if (autocvar_g_multijump > 0)
+                                       self.multijump_count += 1;
                        }
                }
                self.multijump_ready = FALSE; // require releasing and pressing the jump button again for the next jump
@@ -796,8 +797,6 @@ void SV_PlayerPhysics()
                bot_think();
        }
        
-       MUTATOR_CALLHOOK(PlayerPhysics);
-
        self.items &~= IT_USING_JETPACK;
 
        if(self.classname == "player")
@@ -830,6 +829,13 @@ void SV_PlayerPhysics()
        if (self.movetype == MOVETYPE_NONE)
                return;
 
+       // when we get here, disableclientprediction cannot be 2
+       self.disableclientprediction = 0;
+       if(time < self.ladder_time)
+               self.disableclientprediction = 1;
+
+       MUTATOR_CALLHOOK(PlayerPhysics);
+
        maxspd_mod = 1;
 
        swampspd_mod = 1;
@@ -886,6 +892,7 @@ void SV_PlayerPhysics()
        }
 
        if(self.flags & FL_ONGROUND)
+       if(self.classname == "player") // no fall sounds for observers thank you very much
        if(self.wasFlying)
        {
                self.wasFlying = 0;
@@ -989,14 +996,21 @@ void SV_PlayerPhysics()
                // on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
                self.flags &~= FL_ONGROUND;
 
+               float g;
+               g = autocvar_sv_gravity * frametime;
+               if(self.gravity)
+                       g *= self.gravity;
+               if(autocvar_sv_gameplayfix_gravityunaffectedbyticrate)
+               {
+                       g *= 0.5;
+                       self.velocity_z += g;
+               }
+
                self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
                makevectors(self.v_angle);
                //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
                wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
-               if (self.gravity)
-                       self.velocity_z = self.velocity_z + self.gravity * autocvar_sv_gravity * frametime;
-               else
-                       self.velocity_z = self.velocity_z + autocvar_sv_gravity * frametime;
+               self.velocity_z += g;
                if (self.ladder_entity.classname == "func_water")
                {
                        f = vlen(wishvel);