more doublejump improvements
authorfruitiex <fruitiex@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sun, 7 Feb 2010 15:44:21 +0000 (15:44 +0000)
committerfruitiex <fruitiex@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sun, 7 Feb 2010 15:44:21 +0000 (15:44 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8625 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

26 files changed:
data/defaultNexuiz.cfg
data/physics10.cfg
data/physics11.cfg
data/physics151.cfg
data/physics151b.cfg
data/physics16rc1.cfg
data/physics20.cfg
data/physics25.cfg
data/physics26.cfg
data/physicsCPMA.cfg
data/physicsHavoc.cfg
data/physicsLzd.cfg
data/physicsNexrun.cfg
data/physicsNexrun_old.cfg
data/physicsNoQWBunny.cfg
data/physicsQ.cfg
data/physicsQ2.cfg
data/physicsQ2a.cfg
data/physicsQ3.cfg
data/physicsQBF.cfg
data/physicsQBFplus.cfg
data/physicsSamual.cfg
data/physicsWarsow.cfg
data/physicsWarsowClassicBunny.cfg
data/physicsWarsowDev.cfg
data/qcsrc/server/cl_physics.qc

index 7af2333..01e460e 100644 (file)
@@ -330,7 +330,8 @@ set sv_player_crouch_maxs "16 16 25" "maxs of a crouched playermodel"
 
 set sv_pogostick 1 "don't require releasing the space bar for jumping again"
 set sv_doublejump 0 "allow Quake 2-style double jumps"
-set sv_doublejump_speedcap 0 "wont perform a doublejump if z-axis speed is higher than this, 0 = disable check"
+set sv_jumpspeedcap_min "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this"
+set sv_jumpspeedcap_max "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this"
 
 seta sv_precacheplayermodels 1
 seta sv_precacheweapons 0
index 0cd7da8..1514173 100644 (file)
@@ -24,4 +24,5 @@ sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0.5
 sv_doublejump 0
 // 1.0 did not allow re-jumping due to a bug, this is quite close to it
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 600d08c..01a26ef 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0.25
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index b5ee0ea..b0aa650 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index c8df090..e14a218 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 2dbfb4d..cbda5fb 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0.2
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index c2e57bf..dc780e1 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 903b9c3..995284f 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index d2df090..be2ba4d 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 07aadaa..f5226b2 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index e219c2c..5b44015 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 123b155..9313f25 100644 (file)
@@ -24,4 +24,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 39571ba..b88fa7b 100644 (file)
@@ -27,4 +27,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 1
-sv_doublejump_speedcap 270
+sv_jumpspeedcap_min 0
+sv_jumpspeedcap_max 1
index 4b48553..96b8cf4 100644 (file)
@@ -27,4 +27,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 1
-sv_doublejump_speedcap 270
+sv_jumpspeedcap_min 0
+sv_jumpspeedcap_max 1
index 5b12d3e..b79038a 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 5f1031b..5086fc5 100644 (file)
@@ -24,4 +24,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 6601d69..036c31d 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 1
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 565bc08..cd25e47 100644 (file)
@@ -24,4 +24,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 1
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index d27507b..02ae670 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 80d82c1..668b83f 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 810f29d..00b316f 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index a497918..e104783 100644 (file)
@@ -22,4 +22,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8\r
 sv_friction_on_land 0\r
 sv_doublejump 0\r
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index db3cf90..fbe6dd3 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index add4003..d01068e 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 925
 sv_warsowbunny_backtosideratio 0.8
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index f701f7f..353326a 100644 (file)
@@ -23,4 +23,5 @@ sv_warsowbunny_topspeed 900
 sv_warsowbunny_backtosideratio 0.9
 sv_friction_on_land 0
 sv_doublejump 0
-sv_doublejump_speedcap 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
index 67c8d7d..32fecc6 100644 (file)
@@ -30,6 +30,7 @@ float sv_warsowbunny_backtosideratio;
 .float spectatorspeed;
 
 .float doublejump_nextjumptime;
+.float wasinair;
 
 /*
 =============
@@ -66,7 +67,7 @@ void PlayerJump (void)
                return;
 
        if(sv_doublejump)
-               if(time < self.doublejump_nextjumptime)
+               if(time < self.doublejump_nextjumptime || !self.wasinair)
                        return;
 
        if(g_runematch)
@@ -89,8 +90,10 @@ void PlayerJump (void)
                mjumpheight = mjumpheight * cvar("g_minstagib_speed_jumpheight");
        }
 
-       if(self.velocity_z >= cvar("sv_doublejump_speedcap") && cvar("sv_doublejump_speedcap")) // try to "fix" the crazy stair jumps by limiting at which z-axis speeds you can perform a doublejump
-               return; // refuse the jump
+       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") != "")
+               self.velocity_z = min(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_max"), self.velocity_z);
 
        if(!(self.lastflags & FL_ONGROUND))
        {
@@ -852,6 +855,9 @@ void SV_PlayerPhysics()
                else
                        self.flags |= FL_JUMPRELEASED;
 
+               if (!self.wasinair)
+                       self.wasinair = !(self.flags & FL_ONGROUND);
+
                if (self.waterlevel == WATERLEVEL_SWIMMING)
                        CheckWaterJump ();
        }