]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_physics.qc
gradually fade out the "charge" on the nex so if you go fast but hit a wall, you...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index 2df6c1c4fefb2ffbad069cb587cd27e82f22bdff..c9531bbc630d45f2cca4bfc2aeb97e5b248e2072 100644 (file)
@@ -37,6 +37,8 @@ float sv_airspeedlimit_nonqw;
 .float multijump_ready;
 .float prevjumpbutton;
 
+.float nexspeed;
+
 /*
 =============
 PlayerJump
@@ -1323,6 +1325,15 @@ void SV_PlayerPhysics()
                        }
                }
        }
+
+       float f;
+       float xyspeed;
+       f = cvar("g_balance_nex_velocitydependent_falloff_factor");
+       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 = (1 - f) * self.nexspeed;
 :end
        if(self.flags & FL_ONGROUND)
                self.lastground = time;