Skip to content

Commit

Permalink
Use an epsilon when testing height equality PTR_ShootTraverse; I expe…
Browse files Browse the repository at this point in the history
…rienced an infinite loop in the inner algorithm for determining the approximate hitpoint whilst testing AliensTC::E2M5 (far from the only problem I noticed with this mod though) due to this controlling test incorrectly determining that two candidate z coordinates were not equal.
  • Loading branch information
danij committed Feb 13, 2009
1 parent b0a629a commit 7d76644
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/p_map.c
Expand Up @@ -1549,7 +1549,7 @@ boolean PTR_ShootTraverse(intercept_t* in)
d[VY] = pos[VY] - tracePos[VY];
d[VZ] = pos[VZ] - tracePos[VZ];

if(d[VZ] != 0)
if(!INRANGE_OF(d[VZ], 0, .0001f)) // Epsilon
{
contact = R_PointInSubsector(pos[VX], pos[VY]);
step = P_ApproxDistance3(d[VX], d[VY], d[VZ]);
Expand Down

0 comments on commit 7d76644

Please sign in to comment.