mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- return some invalid but recognizable magic value when IntersectLines is being passed two collinear lines.
This actually should check if the two lines are identical but since this is rather expensive and rarely needed it's better handled by returning a distinct value the caller can handle if needed.
This commit is contained in:
parent
e3254a8546
commit
a3dbfab54b
1 changed files with 1 additions and 1 deletions
|
@ -141,7 +141,7 @@ inline double InterceptLineSegments(double v2x, double v2y, double v2dx, double
|
|||
double den = v1dy * v2dx - v1dx * v2dy;
|
||||
|
||||
if (den == 0)
|
||||
return 0; // parallel
|
||||
return -2 * (double)FLT_MAX; // parallel (return a magic value different from everything else, just in case it needs to be handled)
|
||||
|
||||
if (forcansee && den < 0) // cansee does this added check here, aside from that its logic is virtually the same.
|
||||
return -1; // hitting the backside
|
||||
|
|
Loading…
Reference in a new issue