// we hit a warpzone... so, let's perform the trace after the warp again
org = WarpZone_TransformOrigin(wz, trace_endpos);
end = WarpZone_TransformOrigin(wz, end);
+
+ // we got warped, so let's step back a bit
+ tracebox(org, mi, ma, org + normalize(org - end) * 32, nomonsters_adjusted, forent);
+ org = trace_endpos;
}
WarpZone_MakeAllOther();
:fail
tracetoss(e, forent);
if(cb)
cb(e.origin, trace_endpos, trace_endpos);
- e.origin = trace_endpos;
- dt = vlen(e.origin - o0) / vlen(e.velocity);
+ dt = vlen(trace_endpos - e.origin) / vlen(e.velocity);
WarpZone_tracetoss_time += dt;
+ e.origin = trace_endpos;
e.velocity_z -= dt * g;
if(trace_fraction >= 1)
break;
// we hit a warpzone... so, let's perform the trace after the warp again
e.origin = WarpZone_TransformOrigin(wz, e.origin);
e.velocity = WarpZone_TransformVelocity(wz, e.velocity);
+
+ // we got warped, so let's step back a bit
+ e.velocity = -e.velocity;
+ tracetoss(e, forent);
+ dt = vlen(trace_endpos - e.origin) / vlen(e.velocity);
+ WarpZone_tracetoss_time -= dt;
+ e.origin = trace_endpos;
+ e.velocity = -e.velocity;
}
WarpZone_MakeAllOther();
:fail