summaryrefslogtreecommitdiff
path: root/areas/pos.lua
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2019-04-02 18:04:55 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2019-04-02 18:04:55 -0400
commit4ebefe20c921e5ec80f7e95c6f332bf550c92006 (patch)
tree648e84a224ccf1c0dadeb00ce5183db410949219 /areas/pos.lua
parent8555f75acc050f29508d88f1e57159f79cb948d1 (diff)
downloaddreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.tar
dreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.tar.gz
dreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.tar.bz2
dreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.tar.xz
dreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.zip
updated areas (now using the minetest-mods repo), farming redo,
moreblocks, and moreores
Diffstat (limited to 'areas/pos.lua')
-rw-r--r--areas/pos.lua12
1 files changed, 10 insertions, 2 deletions
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