Add a server side option to disable bunnyhopping
authorMario <zacjardine@y7mail.com>
Fri, 9 Oct 2015 12:14:17 +0000 (22:14 +1000)
committerMario <zacjardine@y7mail.com>
Fri, 9 Oct 2015 12:14:17 +0000 (22:14 +1000)
31 files changed:
defaultXonotic.cfg
physics.cfg
physicsCPMA.cfg
physicsFruit.cfg
physicsHavoc.cfg
physicsLeeStricklin-ModdedFruit.cfg
physicsLeeStricklin.cfg
physicsLeeStricklinOld.cfg
physicsLzd.cfg
physicsNexuiz10.cfg
physicsNexuiz11.cfg
physicsNexuiz151.cfg
physicsNexuiz151b.cfg
physicsNexuiz16rc1.cfg
physicsNexuiz20.cfg
physicsNexuiz25.cfg
physicsNexuiz26.cfg
physicsNoQWBunny-nexbased.cfg
physicsQ.cfg
physicsQ2.cfg
physicsQ2a.cfg
physicsQ3.cfg
physicsQBF.cfg
physicsQBFplus.cfg
physicsSamual.cfg
physicsWarsow.cfg
physicsWarsowClassicBunny.cfg
physicsWarsowDev.cfg
qcsrc/common/physics.qc
qcsrc/common/physics.qh
qcsrc/common/stats.qh

index 0afdb7a..3735e55 100644 (file)
@@ -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
index 58d1b1f..e9fe562 100644 (file)
@@ -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
index 9734cfc..e4bbad3 100644 (file)
@@ -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
index 5f65d66..ee44b55 100644 (file)
@@ -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
index f107158..6aac341 100644 (file)
@@ -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
index 3553a94..90eaa49 100644 (file)
@@ -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
index e4aef44..03081fd 100644 (file)
@@ -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
index eda92ac..ef213a7 100644 (file)
@@ -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
index cd76c2f..51c49d7 100644 (file)
@@ -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
index 6c99b30..0ce33aa 100644 (file)
@@ -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
index 65a6a4b..08711fd 100644 (file)
@@ -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
index 833a67d..092985c 100644 (file)
@@ -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
index 31380c9..c6d9bef 100644 (file)
@@ -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
index f3a85e5..5e0ee6a 100644 (file)
@@ -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
index 60071e1..d129a2d 100644 (file)
@@ -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
index dd984bb..8a52299 100644 (file)
@@ -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
index 827bbc5..4df3f21 100644 (file)
@@ -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
index f8d43c4..3e90542 100644 (file)
@@ -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
index c267456..448e087 100644 (file)
@@ -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
index 05e2f14..124c506 100644 (file)
@@ -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
index 9b953e3..580f625 100644 (file)
@@ -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
index eed1c74..6f00896 100644 (file)
@@ -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
index 8dff0ed..31963e9 100644 (file)
@@ -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
index 634b608..8246385 100644 (file)
@@ -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
index 8019089..6858892 100644 (file)
@@ -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
index 7d66b37..50101d7 100644 (file)
@@ -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
index 1dbb14a..c4c3535 100644 (file)
@@ -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
index f2f989d..331723e 100644 (file)
@@ -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
index 1a799c8..cb823b1 100644 (file)
@@ -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;
 
index a249b23..d1f8299 100644 (file)
@@ -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
index eff0eff..9bdcb57 100644 (file)
@@ -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;