Fix the negative fractions coming from edge_portal_dist().

I have a better fix in the works, but I wanted edge_portal_dist() to be
correct.
This commit is contained in:
Bill Currie 2011-12-04 12:11:27 +09:00
parent e5903a60ff
commit ed8e09608a
1 changed files with 1 additions and 1 deletions

View File

@ -368,7 +368,7 @@ edge_portal_dist (const plane_t *plane, const clipport_t *portal,
VectorMultAdd (p1, t, e, y);
VectorSubtract (x, y, y);
t = DotProduct (y, vel) / DotProduct (vel, vel);
if (t >= frac)
if (t < 0 || t >= frac)
continue; // this is not the nearest edge pair
// the edges hit, and they are the closes edge pair so far
frac = t;