aboutsummaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/util.lua b/util.lua
index 1e45914..8639b19 100644
--- a/util.lua
+++ b/util.lua
@@ -1,8 +1,12 @@
+function mesecons_debug.check_pos(pos)
+ return type(pos) == "table" and type(pos.x) == "number" and type(pos.y) == "number" and type(pos.z) == "number"
+end
+
function mesecons_debug.get_blockpos(pos)
return {
x = math.floor(pos.x / 16),
y = math.floor(pos.y / 16),
- z = math.floor(pos.z / 16)
+ z = math.floor(pos.z / 16),
}
end
@@ -10,12 +14,12 @@ function mesecons_debug.hashpos(pos)
return minetest.hash_node_position({
x = math.floor(pos.x / 16),
y = math.floor(pos.y / 16),
- z = math.floor(pos.z / 16)
+ z = math.floor(pos.z / 16),
})
end
-
function mesecons_debug.wait(n)
local wait_until = minetest.get_us_time() + n
- while minetest.get_us_time() < wait_until do end
+ while minetest.get_us_time() < wait_until do
+ end
end