From: Mario Date: Fri, 9 Oct 2015 12:14:17 +0000 (+1000) Subject: Add a server side option to disable bunnyhopping X-Git-Tag: xonotic-v0.8.2~1840 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=67a16f3121a7d968a096c2c24149ce232c4a21fb;p=xonotic%2Fxonotic-data.pk3dir.git Add a server side option to disable bunnyhopping --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 0afdb7af7..3735e5534 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -305,6 +305,7 @@ set sv_doublejump 0 "allow Quake 2-style double jumps" set sv_jumpspeedcap_min "" "lower bound on the baseline velocity of a jump; final velocity will be >= (jumpheight * min + jumpheight)" set sv_jumpspeedcap_max "" "upper bound on the baseline velocity of a jump; final velocity will be <= (jumpheight * max + jumpheight)" set sv_jumpspeedcap_max_disable_on_ramps 0 "disable upper baseline velocity bound on ramps to preserve the old rampjump style" +set sv_track_canjump 0 "track if the player released the jump key between 2 jumps to decide if they are able to jump or not" seta sv_precacheplayermodels 1 seta sv_precacheweapons 0 diff --git a/physics.cfg b/physics.cfg index 58d1b1f81..e9fe56289 100644 --- a/physics.cfg +++ b/physics.cfg @@ -38,6 +38,7 @@ set g_physics_xonotic_accelerate 15 set g_physics_xonotic_stopspeed 100 set g_physics_xonotic_airaccelerate 2 set g_physics_xonotic_airstopaccelerate 3 +set g_physics_xonotic_track_canjump 0 // ======== // Nexuiz @@ -65,6 +66,7 @@ set g_physics_nexuiz_accelerate 8 set g_physics_nexuiz_stopspeed 100 set g_physics_nexuiz_airaccelerate 5.5 set g_physics_nexuiz_airstopaccelerate 0 +set g_physics_nexuiz_track_canjump 0 // ======= // Quake @@ -92,6 +94,7 @@ set g_physics_quake_accelerate 10 set g_physics_quake_stopspeed 100 set g_physics_quake_airaccelerate 106.66666666666666666666 set g_physics_quake_airstopaccelerate 0 +set g_physics_quake_track_canjump 1 // ======== // Warsow @@ -119,6 +122,7 @@ set g_physics_warsow_accelerate 15 set g_physics_warsow_stopspeed 100 set g_physics_warsow_airaccelerate 1 set g_physics_warsow_airstopaccelerate 2.5 +set g_physics_warsow_track_canjump 0 // ======== // DeFrag @@ -146,6 +150,7 @@ set g_physics_defrag_accelerate 15 set g_physics_defrag_stopspeed 100 set g_physics_defrag_airaccelerate 1 set g_physics_defrag_airstopaccelerate 2.5 +set g_physics_defrag_track_canjump 0 // ========= // Quake 3 @@ -173,6 +178,7 @@ set g_physics_quake3_accelerate 10 set g_physics_quake3_stopspeed 100 set g_physics_quake3_airaccelerate 1 set g_physics_quake3_airstopaccelerate 0 +set g_physics_quake3_track_canjump 1 // ======== // Vecxis @@ -200,6 +206,7 @@ set g_physics_vecxis_accelerate 5.5 set g_physics_vecxis_stopspeed 100 set g_physics_vecxis_airaccelerate 5.5 set g_physics_vecxis_airstopaccelerate 0 +set g_physics_vecxis_track_canjump 0 // ========= // Quake 2 @@ -227,6 +234,7 @@ set g_physics_quake2_accelerate 10 set g_physics_quake2_stopspeed 100 set g_physics_quake2_airaccelerate 1 set g_physics_quake2_airstopaccelerate 0 +set g_physics_quake2_track_canjump 1 // ======= // Bones @@ -254,3 +262,4 @@ set g_physics_bones_accelerate 15 set g_physics_bones_stopspeed 100 set g_physics_bones_airaccelerate 1 set g_physics_bones_airstopaccelerate 2.5 +set g_physics_bones_track_canjump 0 diff --git a/physicsCPMA.cfg b/physicsCPMA.cfg index 9734cfc6f..e4bbad3d4 100644 --- a/physicsCPMA.cfg +++ b/physicsCPMA.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 400 +sv_track_canjump 0 diff --git a/physicsFruit.cfg b/physicsFruit.cfg index 5f65d66d8..ee44b5547 100644 --- a/physicsFruit.cfg +++ b/physicsFruit.cfg @@ -33,3 +33,4 @@ sv_jumpspeedcap_min 0 // need predicting? (it should already be in CSQC predicti sv_jumpspeedcap_max 0.35 sv_jumpspeedcap_max_disable_on_ramps 1 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsHavoc.cfg b/physicsHavoc.cfg index f10715872..6aac34178 100644 --- a/physicsHavoc.cfg +++ b/physicsHavoc.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsLeeStricklin-ModdedFruit.cfg b/physicsLeeStricklin-ModdedFruit.cfg index 3553a94a7..90eaa49c1 100644 --- a/physicsLeeStricklin-ModdedFruit.cfg +++ b/physicsLeeStricklin-ModdedFruit.cfg @@ -42,3 +42,4 @@ sv_jumpspeedcap_min 0 // need predicting? (it should already be in CSQC predicti sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 1 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsLeeStricklin.cfg b/physicsLeeStricklin.cfg index e4aef4440..03081fdab 100644 --- a/physicsLeeStricklin.cfg +++ b/physicsLeeStricklin.cfg @@ -42,3 +42,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 1 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsLeeStricklinOld.cfg b/physicsLeeStricklinOld.cfg index eda92ac69..ef213a70f 100644 --- a/physicsLeeStricklinOld.cfg +++ b/physicsLeeStricklinOld.cfg @@ -37,3 +37,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max 0.38 sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsLzd.cfg b/physicsLzd.cfg index cd76c2fe3..51c49d783 100644 --- a/physicsLzd.cfg +++ b/physicsLzd.cfg @@ -35,3 +35,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsNexuiz10.cfg b/physicsNexuiz10.cfg index 6c99b307f..0ce33aa95 100644 --- a/physicsNexuiz10.cfg +++ b/physicsNexuiz10.cfg @@ -35,3 +35,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsNexuiz11.cfg b/physicsNexuiz11.cfg index 65a6a4b6f..08711fd5b 100644 --- a/physicsNexuiz11.cfg +++ b/physicsNexuiz11.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsNexuiz151.cfg b/physicsNexuiz151.cfg index 833a67dce..092985cae 100644 --- a/physicsNexuiz151.cfg +++ b/physicsNexuiz151.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsNexuiz151b.cfg b/physicsNexuiz151b.cfg index 31380c973..c6d9bef4b 100644 --- a/physicsNexuiz151b.cfg +++ b/physicsNexuiz151b.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsNexuiz16rc1.cfg b/physicsNexuiz16rc1.cfg index f3a85e50b..5e0ee6ae0 100644 --- a/physicsNexuiz16rc1.cfg +++ b/physicsNexuiz16rc1.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsNexuiz20.cfg b/physicsNexuiz20.cfg index 60071e184..d129a2db0 100644 --- a/physicsNexuiz20.cfg +++ b/physicsNexuiz20.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsNexuiz25.cfg b/physicsNexuiz25.cfg index dd984bb31..8a5229976 100644 --- a/physicsNexuiz25.cfg +++ b/physicsNexuiz25.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsNexuiz26.cfg b/physicsNexuiz26.cfg index 827bbc55c..4df3f211e 100644 --- a/physicsNexuiz26.cfg +++ b/physicsNexuiz26.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsNoQWBunny-nexbased.cfg b/physicsNoQWBunny-nexbased.cfg index f8d43c4f2..3e905428f 100644 --- a/physicsNoQWBunny-nexbased.cfg +++ b/physicsNoQWBunny-nexbased.cfg @@ -43,3 +43,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 1 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsQ.cfg b/physicsQ.cfg index c26745629..448e087f4 100644 --- a/physicsQ.cfg +++ b/physicsQ.cfg @@ -35,3 +35,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsQ2.cfg b/physicsQ2.cfg index 05e2f1456..124c50660 100644 --- a/physicsQ2.cfg +++ b/physicsQ2.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsQ2a.cfg b/physicsQ2a.cfg index 9b953e32e..580f6257f 100644 --- a/physicsQ2a.cfg +++ b/physicsQ2a.cfg @@ -35,3 +35,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsQ3.cfg b/physicsQ3.cfg index eed1c7409..6f00896b6 100644 --- a/physicsQ3.cfg +++ b/physicsQ3.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 320 +sv_track_canjump 0 diff --git a/physicsQBF.cfg b/physicsQBF.cfg index 8dff0edd9..31963e9fe 100644 --- a/physicsQBF.cfg +++ b/physicsQBF.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsQBFplus.cfg b/physicsQBFplus.cfg index 634b6083e..824638598 100644 --- a/physicsQBFplus.cfg +++ b/physicsQBFplus.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsSamual.cfg b/physicsSamual.cfg index 8019089bf..6858892e3 100644 --- a/physicsSamual.cfg +++ b/physicsSamual.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsWarsow.cfg b/physicsWarsow.cfg index 7d66b3716..50101d73d 100644 --- a/physicsWarsow.cfg +++ b/physicsWarsow.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsWarsowClassicBunny.cfg b/physicsWarsowClassicBunny.cfg index 1dbb14a90..c4c3535a7 100644 --- a/physicsWarsowClassicBunny.cfg +++ b/physicsWarsowClassicBunny.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/physicsWarsowDev.cfg b/physicsWarsowDev.cfg index f2f989d75..331723ec9 100644 --- a/physicsWarsowDev.cfg +++ b/physicsWarsowDev.cfg @@ -34,3 +34,4 @@ sv_jumpspeedcap_min "" sv_jumpspeedcap_max "" sv_jumpspeedcap_max_disable_on_ramps 0 g_teleport_maxspeed 0 +sv_track_canjump 0 diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index 1a799c8de..cb823b107 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -78,7 +78,8 @@ void Physics_AddStats() addstat(STAT_JETPACK_MAXSPEED_SIDE, AS_FLOAT, stat_jetpack_maxspeed_side); // hack to fix track_canjump - addstat(STAT_MOVEVARS_TRACK_CANJUMP, AS_INT, cvar_cl_movement_track_canjump); + addstat(STAT_MOVEVARS_CL_TRACK_CANJUMP, AS_INT, cvar_cl_movement_track_canjump); + addstat(STAT_MOVEVARS_TRACK_CANJUMP, AS_INT, stat_sv_track_canjump); // double jump addstat(STAT_DOUBLEJUMP, AS_INT, stat_doublejump); @@ -175,6 +176,8 @@ void Physics_UpdateStats(float maxspd_mod) self.stat_sv_airstopaccelerate = Physics_ClientOption(self, "airstopaccelerate"); self.stat_sv_jumpvelocity = Physics_ClientOption(self, "jumpvelocity"); + self.stat_sv_track_canjump = Physics_ClientOption(self, "track_canjump"); + self.stat_gameplayfix_upvelocityclearsonground = UPWARD_VELOCITY_CLEARS_ONGROUND; } #endif @@ -591,7 +594,11 @@ bool PlayerJump (void) if (!IS_ONGROUND(self)) return IS_JUMP_HELD(self); - if (PHYS_TRACK_CANJUMP(self)) + bool track_jump = PHYS_CL_TRACK_CANJUMP(self); + if(PHYS_TRACK_CANJUMP(self)) + track_jump = true; + + if (track_jump) if (IS_JUMP_HELD(self)) return true; diff --git a/qcsrc/common/physics.qh b/qcsrc/common/physics.qh index a249b238d..d1f82991c 100644 --- a/qcsrc/common/physics.qh +++ b/qcsrc/common/physics.qh @@ -123,6 +123,7 @@ bool IsFlying(entity a); #define PHYS_JUMPSPEEDCAP_MAX cvar_string("cl_jumpspeedcap_max") #define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS getstati(STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS) + #define PHYS_CL_TRACK_CANJUMP(s) getstati(STAT_MOVEVARS_CL_TRACK_CANJUMP) #define PHYS_TRACK_CANJUMP(s) getstati(STAT_MOVEVARS_TRACK_CANJUMP) #define PHYS_ACCELERATE getstatf(STAT_MOVEVARS_ACCELERATE) #define PHYS_AIRACCEL_QW(s) getstatf(STAT_MOVEVARS_AIRACCEL_QW) @@ -247,6 +248,8 @@ bool IsFlying(entity a); .float stat_nostep; .float stat_jumpstep; + .bool stat_sv_track_canjump; + #define PHYS_INPUT_ANGLES(s) s.v_angle #define PHYS_WORLD_ANGLES(s) s.angles @@ -323,7 +326,8 @@ bool IsFlying(entity a); #define PHYS_JUMPSPEEDCAP_MAX autocvar_sv_jumpspeedcap_max #define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS autocvar_sv_jumpspeedcap_max_disable_on_ramps - #define PHYS_TRACK_CANJUMP(s) s.cvar_cl_movement_track_canjump + #define PHYS_CL_TRACK_CANJUMP(s) s.cvar_cl_movement_track_canjump + #define PHYS_TRACK_CANJUMP(s) s.stat_sv_track_canjump #define PHYS_ACCELERATE self.stat_sv_accelerate #define PHYS_AIRACCEL_QW(s) s.stat_sv_airaccel_qw #define PHYS_AIRACCEL_QW_STRETCHFACTOR(s) self.stat_sv_airaccel_qw_stretchfactor diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index eff0eff80..9bdcb5773 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -245,10 +245,10 @@ const int STAT_GAMEPLAYFIX_EASIERWATERJUMP = 190; const int STAT_MOVEVARS_FRICTION_SLICK = 191; const int STAT_MOVEVARS_FRICTION_ONLAND = 192; const int STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS = 193; -// 194 empty? +const int STAT_MOVEVARS_TRACK_CANJUMP = 194; // 195 empty? const int STAT_DOUBLEJUMP = 196; -const int STAT_MOVEVARS_TRACK_CANJUMP = 197; +const int STAT_MOVEVARS_CL_TRACK_CANJUMP = 197; const int STAT_MULTIJUMP_ADD = 198; const int STAT_MULTIJUMP_SPEED = 199; const int STAT_MULTIJUMP = 200;