]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_physics.qc
I have no idea why, but this fixes the mine layer.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index 08f355be88f2757d46e49657a167e384a2ced687..d9394deaf26a968573d2331a5c78d87d227a5ccd 100644 (file)
@@ -37,6 +37,8 @@ float sv_airspeedlimit_nonqw;
 .float multijump_ready;
 .float prevjumpbutton;
 
+.float nexspeed;
+
 /*
 =============
 PlayerJump
@@ -85,7 +87,7 @@ void PlayerJump (void)
                {
                        if (cvar("g_multijump_add") == 0) // in this case we make the z velocity == jumpvelocity
                        {
-                               if (self.velocity_z >= mjumpheight)
+                               if (self.velocity_z < mjumpheight)
                                {
                                        doublejump = TRUE;
                                        self.velocity_z = 0;
@@ -103,9 +105,9 @@ void PlayerJump (void)
 
                                        curspeed = max(
                                                vlen(vec2(self.velocity)), // current xy speed
-                                               vlen(vec2(antilag_takebackavgvelocity(self, time - 0.25, time))) // average xy topspeed over the last 0.25 secs
+                                               vlen(vec2(antilag_takebackavgvelocity(self, max(self.lastteleporttime + sys_frametime, time - 0.25), time))) // average xy topspeed over the last 0.25 secs
                                        );
-                                       makevectors(self.v_angle); // this always is '0 y 0'
+                                       makevectors(self.v_angle_y * '0 1 0');
                                        wishvel = v_forward * self.movement_x + v_right * self.movement_y;
                                        wishdir = normalize(wishvel);
 
@@ -1323,6 +1325,15 @@ void SV_PlayerPhysics()
                        }
                }
        }
+
+       float f;
+       float xyspeed;
+       f = cvar("g_balance_nex_velocitydependent_falloff_rate");
+       xyspeed = vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y);
+       if(xyspeed > self.nexspeed)
+               self.nexspeed = min(xyspeed, cvar("g_balance_nex_velocitydependent_maxspeed"));
+       else
+               self.nexspeed = max(cvar("g_balance_nex_velocitydependent_minspeed"), self.nexspeed - f * frametime);
 :end
        if(self.flags & FL_ONGROUND)
                self.lastground = time;