From: Mario Date: Thu, 6 Feb 2020 12:29:03 +0000 (+1000) Subject: Add an option to control the maximum speed you can be traveling for stepping down... X-Git-Tag: xonotic-v0.8.5~1128^2~2^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8055762a482cc2ba1d4735e193938c00c7d8d660;p=xonotic%2Fxonotic-data.pk3dir.git Add an option to control the maximum speed you can be traveling for stepping down to apply (ignored by slick surfaces) --- diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index 0c8bc6948..52610c58b 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -16,6 +16,7 @@ const int WATERLEVEL_SUBMERGED = 3; #define GAMEPLAYFIX_DOWNTRACEONGROUND(s) STAT(GAMEPLAYFIX_DOWNTRACEONGROUND) #define GAMEPLAYFIX_EASIERWATERJUMP(s) STAT(GAMEPLAYFIX_EASIERWATERJUMP) #define GAMEPLAYFIX_STEPDOWN(s) STAT(GAMEPLAYFIX_STEPDOWN) +#define GAMEPLAYFIX_STEPDOWN_MAXSPEED(s) STAT(GAMEPLAYFIX_STEPDOWN_MAXSPEED) #define GAMEPLAYFIX_STEPMULTIPLETIMES(s) STAT(GAMEPLAYFIX_STEPMULTIPLETIMES) #define GAMEPLAYFIX_UNSTICKPLAYERS(s) STAT(GAMEPLAYFIX_UNSTICKPLAYERS) #define GAMEPLAYFIX_WATERTRANSITION(s) STAT(GAMEPLAYFIX_WATERTRANSITION) diff --git a/qcsrc/common/physics/movetypes/walk.qc b/qcsrc/common/physics/movetypes/walk.qc index 13224f8a3..e0d05d7c5 100644 --- a/qcsrc/common/physics/movetypes/walk.qc +++ b/qcsrc/common/physics/movetypes/walk.qc @@ -143,7 +143,8 @@ void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove _Movetype_WallFriction(this, move_stepnormal); } // don't do the down move if stepdown is disabled, moving upward, not in water, or the move started offground or ended onground - else if (!GAMEPLAYFIX_STEPDOWN(this) || this.waterlevel >= 3 || start_velocity.z >= (1.0 / 32.0) || !oldonground || IS_ONGROUND(this)) + else if (!GAMEPLAYFIX_STEPDOWN(this) || this.waterlevel >= 3 || start_velocity.z >= (1.0 / 32.0) + || !oldonground || IS_ONGROUND(this) || (GAMEPLAYFIX_STEPDOWN_MAXSPEED(this) && vdist(start_velocity, >=, GAMEPLAYFIX_STEPDOWN_MAXSPEED(this)) && !IS_ONSLICK(this))) { return; } diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 7d2aae5f4..ed37073fb 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -190,6 +190,7 @@ REGISTER_STAT(BUGRIGS_STEER, float, g_bugrigs_steer) int autocvar_sv_gameplayfix_downtracesupportsongroundflag = 1; int autocvar_sv_gameplayfix_easierwaterjump = 1; int autocvar_sv_gameplayfix_stepdown = 2; +float autocvar_sv_gameplayfix_stepdown_maxspeed = 0; int autocvar_sv_gameplayfix_stepmultipletimes = 1; int autocvar_sv_gameplayfix_unstickplayers = 1; int autocvar_sv_gameplayfix_fixedcheckwatertransition = 1; @@ -201,6 +202,7 @@ int autocvar_sv_gameplayfix_noairborncorpse_allowsuspendeditems = 1; REGISTER_STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, int, autocvar_sv_gameplayfix_downtracesupportsongroundflag) REGISTER_STAT(GAMEPLAYFIX_EASIERWATERJUMP, int, autocvar_sv_gameplayfix_easierwaterjump) REGISTER_STAT(GAMEPLAYFIX_STEPDOWN, int, autocvar_sv_gameplayfix_stepdown) +REGISTER_STAT(GAMEPLAYFIX_STEPDOWN_MAXSPEED, float, autocvar_sv_gameplayfix_stepdown_maxspeed) REGISTER_STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, int, autocvar_sv_gameplayfix_stepmultipletimes) REGISTER_STAT(GAMEPLAYFIX_UNSTICKPLAYERS, int, autocvar_sv_gameplayfix_unstickplayers) REGISTER_STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND, int, autocvar_sv_gameplayfix_upwardvelocityclearsongroundflag) diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 87ab27076..2bdc62bd1 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -394,6 +394,8 @@ sv_gameplayfix_delayprojectiles 0 sv_gameplayfix_q2airaccelerate 1 sv_gameplayfix_stepmultipletimes 1 sv_gameplayfix_stepdown 2 +// only available in qc physics +set sv_gameplayfix_stepdown_maxspeed 0 "maximum speed the entity can be moving for stepping down to apply" // delay for "kill" to prevent abuse set g_balance_kill_delay 2 "timer before death when using the kill command"