[nexuiz-commits] r8628 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Feb 10 11:38:50 EST 2010
Author: fruitiex
Date: 2010-02-10 11:38:49 -0500 (Wed, 10 Feb 2010)
New Revision: 8628
Modified:
trunk/data/qcsrc/server/cl_physics.qc
Log:
sv_doublejump: trace only 0.01 units down instead of 1, this fixes the
"doublejump off flat ground bug". If this causes problems with
inaccuracies we can just ramp it up a bit... so far I haven't spotted
any problems even on looves_insane :)
Modified: trunk/data/qcsrc/server/cl_physics.qc
===================================================================
--- trunk/data/qcsrc/server/cl_physics.qc 2010-02-09 13:37:45 UTC (rev 8627)
+++ trunk/data/qcsrc/server/cl_physics.qc 2010-02-10 16:38:49 UTC (rev 8628)
@@ -29,9 +29,6 @@
.float wasFlying;
.float spectatorspeed;
-.float doublejump_nextjumptime;
-.float wasinair;
-
/*
=============
PlayerJump
@@ -66,10 +63,6 @@
if(self.health <= g_bloodloss)
return;
- if(sv_doublejump)
- if(time < self.doublejump_nextjumptime || !self.wasinair)
- return;
-
if(g_runematch)
{
if(self.runes & RUNE_SPEED)
@@ -123,21 +116,6 @@
if(g_jump_grunt)
PlayerSound(playersound_jump, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);
- if(sv_doublejump)
- {
- // we're moving upwards at self.velocity_z
- // only allow jumping after we got 2 units upwards
- // so we for sure leave the FL_ONGROUND check
- //
- // but as this sucks because of factoring in gravity, we'll just do it
- // for 3 units, and constant velocity
- if(self.velocity_z >= mjumpheight * 0.5) // only do this when we won't INTENTIONALLY jump a second time... TODO make a better check for this
- {
- self.doublejump_nextjumptime = time + 3 / max(30, self.velocity_z); // max 0.1s blocking of jumps, typically just one frame
- //print(sprintf("blocking jumps for next %f seconds (vel: %f to %f)\n", self.doublejump_nextjumptime - time, self.velocity_z - mjumpheight, self.velocity_z));
- }
- }
-
self.restart_jump = -1; // restart jump anim next time
// value -1 is used to not use the teleport bit (workaround for tiny hitch when re-jumping)
}
@@ -845,7 +823,7 @@
if(sv_doublejump)
{
self.flags &~= FL_ONGROUND;
- tracebox(self.origin + '0 0 1', self.mins, self.maxs, self.origin - '0 0 1', MOVE_NORMAL, self);
+ 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.7)
self.flags |= FL_ONGROUND;
}
@@ -855,9 +833,6 @@
else
self.flags |= FL_JUMPRELEASED;
- if (!self.wasinair)
- self.wasinair = !(self.flags & FL_ONGROUND);
-
if (self.waterlevel == WATERLEVEL_SWIMMING)
CheckWaterJump ();
}
More information about the nexuiz-commits
mailing list