]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
rename sv_speedlimit to sv_airspeedlimit_nonqw
authorRudolf Polzer <divverent@alientrap.org>
Fri, 4 Jun 2010 21:46:53 +0000 (23:46 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 4 Jun 2010 21:46:53 +0000 (23:46 +0200)
qcsrc/common/constants.qh
qcsrc/server/cl_physics.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/sv_main.qc

index d747b70dbe44ea9da825aab2506a788ce1821a66..2fe55b1688bffd5295e2c9af812e4659f28f8931 100644 (file)
@@ -281,6 +281,7 @@ const float STAT_LEADLIMIT = 47;
 const float STAT_BULLETS_LOADED = 48;
 
 // see DP source, quakedef.h
+const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
 const float STAT_MOVEVARS_AIRSTRAFEACCEL_QW = 223;
 const float STAT_MOVEVARS_AIRACCEL_QW = 254;
 
index 5e70e79bd4d29902e71e6a32b247e924e80be631..3a405c40be8f52fe179c71cb631ec044da90213c 100644 (file)
@@ -21,7 +21,7 @@ float sv_warsowbunny_accel;
 float sv_warsowbunny_topspeed;
 float sv_warsowbunny_turnaccel;
 float sv_warsowbunny_backtosideratio;
-float sv_speedlimit;
+float sv_airspeedlimit_nonqw;
 
 .float ladder_time;
 .entity ladder_entity;
@@ -488,7 +488,7 @@ float AdjustAirAccelQW(float accelqw, float factor)
 //   sv_airaccel_sideways_friction 0
 //   prvm_globalset server speedclamp_mode 1
 //     (or 2)
-void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float sidefric)
+void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float sidefric, float speedlimit)
 {
        float vel_straight;
        float vel_z;
@@ -515,8 +515,8 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
        step = accel * frametime * wishspeed0;
 
        vel_xy_current  = vlen(vel_xy);
-       if(sv_speedlimit)
-               accelqw = AdjustAirAccelQW(accelqw, (sv_speedlimit - bound(wishspeed, vel_xy_current, sv_speedlimit)) / max(1, sv_speedlimit - wishspeed));
+       if(speedlimit)
+               accelqw = AdjustAirAccelQW(accelqw, (speedlimit - bound(wishspeed, vel_xy_current, speedlimit)) / max(1, speedlimit - wishspeed));
        vel_xy_forward  = vel_xy_current + bound(0, wishspeed - vel_xy_current, step) * accelqw + step * (1 - accelqw);
        vel_xy_backward = vel_xy_current - bound(0, wishspeed + vel_xy_current, step) * accelqw - step * (1 - accelqw);
        if(vel_xy_backward < 0)
@@ -657,6 +657,7 @@ void SV_PlayerPhysics()
                self.stat_sv_airstrafeaccel_qw = AdjustAirAccelQW(sv_airstrafeaccel_qw, autocvar_g_movement_highspeed);
        else
                self.stat_sv_airstrafeaccel_qw = 0;
+       self.stat_sv_airspeedlimit_nonqw = sv_airspeedlimit_nonqw * autocvar_g_movement_highspeed;
 
     if(self.PlayerPhysplug)
         if(self.PlayerPhysplug())
@@ -932,7 +933,7 @@ void SV_PlayerPhysics()
                if (wishspeed > sv_maxspeed*maxspd_mod)
                        wishspeed = sv_maxspeed*maxspd_mod;
                if (time >= self.teleport_time)
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
        }
        else if (self.waterlevel >= WATERLEVEL_SWIMMING)
        {
@@ -955,7 +956,7 @@ void SV_PlayerPhysics()
                self.velocity = self.velocity * (1 - frametime * sv_friction);
 
                // water acceleration
-               PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
+               PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
        }
        else if (time < self.ladder_time)
        {
@@ -998,7 +999,7 @@ void SV_PlayerPhysics()
                if (time >= self.teleport_time)
                {
                        // water acceleration
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
                }
        }
        else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
@@ -1158,7 +1159,7 @@ void SV_PlayerPhysics()
                if (self.crouch)
                        wishspeed = wishspeed * 0.5;
                if (time >= self.teleport_time)
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
        }
        else
        {
@@ -1224,7 +1225,7 @@ void SV_PlayerPhysics()
                        if(sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
                                PM_AirAccelerate(wishdir, wishspeed);
                        else
-                               PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, sv_airaccel_sideways_friction / maxairspd);
+                               PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
 
                        if(sv_aircontrol)
                                CPM_PM_Aircontrol(wishdir, wishspeed2);
index fec2a0976f196e2f1e29c154b1f86587f57057b9..4d701772434caba1f8b589f5179f227e51b1d461 100644 (file)
@@ -536,6 +536,7 @@ float game_starttime; //point in time when the countdown is over
 
 .float stat_sv_airaccel_qw;
 .float stat_sv_airstrafeaccel_qw;
+.float stat_sv_airspeedlimit_nonqw;
 
 void W_Porto_Remove (entity p);
 
index e969146ca40e145ed8e73e7e04a20f1f09e94330..f873ea7c6b00331ed188b2bf1bf3f030f165fc4f 100644 (file)
@@ -636,6 +636,7 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);
 
        // g_movementspeed hack
+       addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
        addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
        addstat(STAT_MOVEVARS_AIRSTRAFEACCEL_QW, AS_FLOAT, stat_sv_airstrafeaccel_qw);
 
index 85ff7760b3b912e8ea836f47d53639599a81cc8d..45320f2db526f0303cb0f3e9d8aed3181e78c9e7 100644 (file)
@@ -198,7 +198,7 @@ void StartFrame (void)
        sv_warsowbunny_topspeed = cvar("sv_warsowbunny_topspeed");
        sv_warsowbunny_turnaccel = cvar("sv_warsowbunny_turnaccel");
        sv_warsowbunny_backtosideratio = cvar("sv_warsowbunny_backtosideratio");
-       sv_speedlimit = cvar("sv_speedlimit");
+       sv_airspeedlimit_nonqw = cvar("sv_airspeedlimit_nonqw");
        teamplay = cvar ("teamplay");
        sys_frametime = cvar("sys_ticrate") * cvar("slowmo");
        sv_doublejump = cvar("sv_doublejump");