Simplified checkIfWallsBetween calculation.

This commit is contained in:
MobiusDev 2016-02-16 07:56:21 +00:00
parent 81be59fcd2
commit 654b5748d3

View File

@ -118,9 +118,6 @@ public class WallData implements IXmlReader
}
for (WallHolder wall : allWalls)
{
boolean intersectFace = false;
for (int i = 0; i < 2; i++)
{
// lower part of the multiplier fraction, if it is 0 we avoid an error and also know that the lines are parallel
final int denominator = ((ty - y) * (wall.getPoint1X() - wall.getPoint2X())) - ((tx - x) * (wall.getPoint1Y() - wall.getPoint2Y()));
@ -137,14 +134,9 @@ public class WallData implements IXmlReader
final int intersectZ = Math.round(z + (multiplier1 * (tz - z)));
// now checking if the resulting point is between door's min and max z
if ((intersectZ > wall.getZMin()) && (intersectZ < wall.getZMax()))
{
if (intersectFace)
{
return true;
}
intersectFace = true;
}
}
}
}
return false;