From 023cb81f9e04082208e30b79d1979e8b7a41ed66 Mon Sep 17 00:00:00 2001 From: DS-Minetest Date: Fri, 28 Jul 2017 15:29:23 +0200 Subject: [PATCH] improve --- api.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api.lua b/api.lua index b149116..6e5d0f1 100644 --- a/api.lua +++ b/api.lua @@ -18,10 +18,9 @@ end function areas:getAreasAtPos(pos) local res = {} - if math.abs(pos.x) > 2147483 or math.abs(pos.y) > 2147483 or - math.abs(pos.z) > 2147483 then - return res - end + pos = vector.apply(pos, function(p) + return math.max(math.min(p, 2147483), -2147483) + end) if self.store then local a = self.store:get_areas_for_pos(pos, false, true)