From 4ebefe20c921e5ec80f7e95c6f332bf550c92006 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Tue, 2 Apr 2019 18:04:55 -0400 Subject: updated areas (now using the minetest-mods repo), farming redo, moreblocks, and moreores --- areas/pos.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'areas/pos.lua') diff --git a/areas/pos.lua b/areas/pos.lua index 8d3e6fe..e97e4fc 100644 --- a/areas/pos.lua +++ b/areas/pos.lua @@ -129,13 +129,21 @@ function areas:getPos(playerName) return areas:sortPos(pos1, pos2) end +local function posLimit(pos) + return { + x = math.max(math.min(pos.x, 31000), -31000) + y = math.max(math.min(pos.y, 31000), -31000) + z = math.max(math.min(pos.z, 31000), -31000) + } +end + function areas:setPos1(playerName, pos) - areas.pos1[playerName] = pos + areas.pos1[playerName] = posLimit(pos) areas.markPos1(playerName) end function areas:setPos2(playerName, pos) - areas.pos2[playerName] = pos + areas.pos2[playerName] = posLimit(pos) areas.markPos2(playerName) end -- cgit v1.2.3