Minor WallData change.

This commit is contained in:
MobiusDev 2016-02-19 08:00:01 +00:00
parent af3f5ce7b7
commit 18f610bb3d

View File

@ -112,11 +112,8 @@ public class WallData implements IXmlReader
} }
final Collection<WallHolder> allWalls = _walls.get(MapRegionManager.getInstance().getMapRegionLocId(x, y)); final Collection<WallHolder> allWalls = _walls.get(MapRegionManager.getInstance().getMapRegionLocId(x, y));
if (allWalls == null) if (allWalls != null)
{ {
return false;
}
for (WallHolder wall : allWalls) for (WallHolder wall : allWalls)
{ {
// lower part of the multiplier fraction, if it is 0 we avoid an error and also know that the lines are parallel // lower part of the multiplier fraction, if it is 0 we avoid an error and also know that the lines are parallel
@ -132,13 +129,14 @@ public class WallData implements IXmlReader
if ((multiplier1 >= 0) && (multiplier1 <= 1) && (multiplier2 >= 0) && (multiplier2 <= 1)) if ((multiplier1 >= 0) && (multiplier1 <= 1) && (multiplier2 >= 0) && (multiplier2 <= 1))
{ {
final int intersectZ = Math.round(z + (multiplier1 * (tz - z))); final int intersectZ = Math.round(z + (multiplier1 * (tz - z)));
// now checking if the resulting point is between door's min and max z // now checking if the resulting point is between the wall min and max z
if ((intersectZ > wall.getZMin()) && (intersectZ < wall.getZMax())) if ((intersectZ > wall.getZMin()) && (intersectZ < wall.getZMax()))
{ {
return true; return true;
} }
} }
} }
}
return false; return false;
} }