]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_physics.qc
new air control math, new cvar sv_aircontrol_power
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index c136ef7b0a6e40f6ed96a5c69def085613599e0a..ff5fbaa37ee4cf436796d3bc709e8164993c5de6 100644 (file)
@@ -14,6 +14,7 @@ float sv_airstopaccelerate;
 float sv_airstrafeaccelerate;
 float sv_maxairstrafespeed;
 float sv_aircontrol;
+float sv_aircontrol_power;
 float sv_warsowbunny_airforwardaccel;
 float sv_warsowbunny_accel;
 float sv_warsowbunny_topspeed;
@@ -87,7 +88,7 @@ void PlayerJump (void)
                self.velocity_z = max(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_min"), self.velocity_z);
        if(cvar_string("sv_jumpspeedcap_max") != "") {
                if(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")) {
-                       // don't do jump speedcaps on ramps to preserve old nexuiz ramjump style
+                       // don't do jump speedcaps on ramps to preserve old xonotic ramjump style
                        //print("Trace plane normal z: ", ftos(trace_plane_normal_z), ", disabling speed cap!\n");
                }
                else
@@ -416,10 +417,10 @@ void CPM_PM_Aircontrol(vector wishdir, float wishspeed)
        xyspeed = vlen(self.velocity); self.velocity = normalize(self.velocity);
 
        dot = self.velocity * wishdir;
-       k *= sv_aircontrol*dot*dot*frametime;
 
        if(dot > 0) // we can't change direction while slowing down
        {
+               k *= fabs(sv_aircontrol)*pow(dot, sv_aircontrol_power)*frametime;
                self.velocity = normalize(self.velocity * xyspeed + wishdir * k);
        }
 
@@ -542,7 +543,6 @@ void PM_AirAccelerate(vector wishdir, float wishspeed)
 .vector v_angle_old;
 .string lastclassname;
 
-void Nixnex_GiveCurrentWeapon();
 .float() PlayerPhysplug;
 
 string specialcommand = "xwxwxsxsxaxdxaxdx1x ";
@@ -689,6 +689,8 @@ void SV_PlayerPhysics()
                bot_think();
        }
        
+       MUTATOR_CALLHOOK(PlayerPhysics);
+
        self.items &~= IT_USING_JETPACK;
 
        if(self.classname == "player")