From 9c7e68314092345caf25be35a15e2dec576cdff2 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 4 Jun 2010 23:46:53 +0200 Subject: [PATCH] rename sv_speedlimit to sv_airspeedlimit_nonqw --- qcsrc/common/constants.qh | 1 + qcsrc/server/cl_physics.qc | 19 ++++++++++--------- qcsrc/server/defs.qh | 1 + qcsrc/server/g_world.qc | 1 + qcsrc/server/sv_main.qc | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index d747b70db..2fe55b168 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -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; diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index 5e70e79bd..3a405c40b 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -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); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index fec2a0976..4d7017724 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -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); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index e969146ca..f873ea7c6 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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); diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 85ff7760b..45320f2db 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -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"); -- 2.39.2