float sv_warsowbunny_topspeed;
float sv_warsowbunny_turnaccel;
float sv_warsowbunny_backtosideratio;
+float sv_speedlimit;
.float ladder_time;
.entity ladder_entity;
self.velocity_z = zspeed;
}
+float AdjustAirAccelQW(float accelqw, float factor)
+{
+ return copysign(bound(0.000001, 1 - (1 - fabs(accelqw)) * factor, 1), accelqw);
+}
+
// example config for alternate speed clamping:
// sv_airaccel_qw 0.8
// sv_airaccel_sideways_friction 0
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));
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)
string c;
// fix physics stats for g_movement_highspeed
- self.stat_sv_airaccel_qw = copysign(bound(0, 1-(1-fabs(sv_airaccel_qw))*autocvar_g_movement_highspeed, 1), sv_airaccel_qw);
+ self.stat_sv_airaccel_qw = AdjustAirAccelQW(sv_airaccel_qw, autocvar_g_movement_highspeed);
if(sv_airstrafeaccel_qw)
- self.stat_sv_airstrafeaccel_qw = copysign(bound(0.001, 1-(1-fabs(sv_airstrafeaccel_qw))*autocvar_g_movement_highspeed, 1), sv_airstrafeaccel_qw);
+ self.stat_sv_airstrafeaccel_qw = AdjustAirAccelQW(sv_airstrafeaccel_qw, autocvar_g_movement_highspeed);
else
self.stat_sv_airstrafeaccel_qw = 0;
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");
teamplay = cvar ("teamplay");
sys_frametime = cvar("sys_ticrate") * cvar("slowmo");