Will stick to basic isInRange check function.

This commit is contained in:
BenDol 2014-06-02 11:43:29 +12:00
parent adcf258551
commit d2b7de3801
1 changed files with 2 additions and 3 deletions

View File

@ -20,7 +20,6 @@ function Position.lessThan(pos1, pos2, orEqualTo)
end
end
function Position.isInRange(pos1, pos2, minXRange, maxXRange, minYRange, maxYRange)
return (pos2.x >= pos1.x-minXRange and pos2.x <= pos1.x+maxXRange and pos2.y
>= pos1.y-minYRange and pos2.y <= pos1.y+maxYRange and pos2.z == pos1.z);
function Position.isInRange(pos1, pos2, xRange, yRange)
return math.abs(pos1.x-pos2.x) <= xRange and math.abs(pos1.y-pos2.y) <= yRange and pos1.z == pos2.z;
end