X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Fcl_physics.qc;h=d3425451c15c94419b1b16fd3c3821e9c441e97d;hb=1d6afe45aaa54ca8bedc4a0a1b4f0c86b3c7ba4c;hp=bbe9ff7b7e670697eddc806fa6068d15f4cd4af7;hpb=3f1a50be2f4c4aca9f539b8acd1242d85cc1d0f2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index bbe9ff7b7..d3425451c 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -88,6 +88,7 @@ void PlayerJump (void) if(cvar_string("sv_jumpspeedcap_min") != "") self.velocity_z = max(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_min"), self.velocity_z); if(cvar_string("sv_jumpspeedcap_max") != "") { + tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self); 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 xonotic ramjump style //print("Trace plane normal z: ", ftos(trace_plane_normal_z), ", disabling speed cap!\n"); @@ -605,6 +606,7 @@ string GetMapname(void); float speedaward_lastupdate; float speedaward_lastsent; .float jumppadusetime; +var float autocvar_g_movement_highspeed = 1; void SV_PlayerPhysics() { local vector wishvel, wishdir, v; @@ -614,6 +616,13 @@ void SV_PlayerPhysics() float not_allowed_to_move; 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); + 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); + else + self.stat_sv_airstrafeaccel_qw = 0; + if(self.PlayerPhysplug) if(self.PlayerPhysplug()) return; @@ -1160,7 +1169,7 @@ void SV_PlayerPhysics() float airaccelqw; float strafity; - airaccelqw = sv_airaccel_qw; + airaccelqw = self.stat_sv_airaccel_qw; accelerating = (self.velocity * wishdir > 0); wishspeed2 = wishspeed; @@ -1168,9 +1177,6 @@ void SV_PlayerPhysics() if(sv_airstopaccelerate) if(self.velocity * wishdir < 0) airaccel = sv_airstopaccelerate*maxspd_mod; - // this doesn't play well with analog input, but can't r - // fixed like the AirControl can. So, don't set the maxa - // cvars when you want to support analog input. // note that for straight forward jumping: // step = accel * frametime * wishspeed0; // accel = bound(0, wishspeed - vel_xy_current, step) * accelqw + step * (1 - accelqw); @@ -1184,8 +1190,8 @@ void SV_PlayerPhysics() wishspeed = min(wishspeed, GeomLerp(sv_maxairspeed*maxspd_mod, strafity, sv_maxairstrafespeed*maxspd_mod)); if(sv_airstrafeaccelerate) airaccel = GeomLerp(airaccel, strafity, sv_airstrafeaccelerate*maxspd_mod); - if(sv_airstrafeaccel_qw) - airaccelqw = sign((strafity > 0.5) ? sv_airstrafeaccel_qw : sv_airaccel_qw) * (1-GeomLerp(1-fabs(sv_airaccel_qw), strafity, 1-fabs(sv_airstrafeaccel_qw))); + if(self.stat_sv_airstrafeaccel_qw) + airaccelqw = copysign(1-GeomLerp(1-fabs(self.stat_sv_airaccel_qw), strafity, 1-fabs(self.stat_sv_airstrafeaccel_qw)), ((strafity > 0.5) ? self.stat_sv_airstrafeaccel_qw : self.stat_sv_airaccel_qw)); // !CPM if(sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)