Will stick to basic isInRange check function.
This commit is contained in:
parent
adcf258551
commit
d2b7de3801
|
@ -20,7 +20,6 @@ function Position.lessThan(pos1, pos2, orEqualTo)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Position.isInRange(pos1, pos2, minXRange, maxXRange, minYRange, maxYRange)
|
function Position.isInRange(pos1, pos2, xRange, yRange)
|
||||||
return (pos2.x >= pos1.x-minXRange and pos2.x <= pos1.x+maxXRange and pos2.y
|
return math.abs(pos1.x-pos2.x) <= xRange and math.abs(pos1.y-pos2.y) <= yRange and pos1.z == pos2.z;
|
||||||
>= pos1.y-minYRange and pos2.y <= pos1.y+maxYRange and pos2.z == pos1.z);
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue