|
From: Cobalt <co...@te...> - 2016-05-16 18:46:39
|
While Darkplaces uses a gameplayfix cvar that activated I believe QW's new
improved waterjumping, there is still an issue it does not fix...you can see
mostly only on the map DM5. If you go in the water and try to wj into the
area that has the 666 and are to the extreme left or right , your head hits
the top of the map....and it will perpetually waterjump you forever until
you move more toward the center.
I came up with this new code which takes care of this case on DM5, however
there is now a new problem on a map such as DM3, where if you are in the
water and try to waterjump onto the bridge near its end, its got a angled
corner, so you wont be able to wj unless you are facing closer to the
center.
Not sue if anyone wants to try the code, here it is, and if there is an idea
for fixing the DM3 problem, would like to hear it. I suppose we could check
only for the DM5 map and bypass the new check, and that would fix it, but
maybe there is a better way because other maps can be made and possibly
exhibit this same problem.
void ()
CheckWaterJump =
{
if (self.cl[CL_CMD_FORWARD] <= 0) return; // For Proquake mostly,
dont proceed unless we are traveling forward
local vector start, end;
// check for a jump-out-of-water
makevectors (self.angles);
start = self.origin;
start_z = start_z + 8;
v_forward_z = 0;
normalize (v_forward);
end = start + v_forward * 24;
traceline (start, end, TRUE, self);
if (trace_fraction < 1)
{ // solid at waist
start_z = start_z + self.maxs_z - 8;
end = start + v_forward * 24;
traceline (start, end, TRUE, self);
if (trace_fraction == 1)
{ // open at eye level
local float safe;
start = end;
traceline (start, end + v_right * 16, TRUE,
self);
if (trace_fraction == 1) // clear this side
{
safe = safe + 1;
traceline (start, end + v_right * -16, TRUE,
self);
if (trace_fraction == 1) // clear other side
safe = safe + 1;
}
if (safe == 2)
{
self.flags = self.flags | FL_WATERJUMP;
local float vj;
if (self.items & IT_SUIT) // Larger boost for
suit - optional
vj = 1.1;
else vj = 1.05;
self.velocity_z = (vlen(self.velocity * vj));
// Different calc than ID had, better?
self.movedir = trace_plane_normal * -50;
self.flags = self.flags - (self.flags &
FL_JUMPRELEASED);
self.teleport_time = time + 2; // safety
net
}
}
}
};
|