From 85e849767f760d5a6cd22409b458de20acbb6bd2 Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Mon, 29 May 2017 02:49:02 -0700 Subject: [PATCH] Add method 'sneeker.get_pos_string': Returns x, y, z coordinates in a string. --- functions.lua | 5 +++++ spawn.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/functions.lua b/functions.lua index 20f2dd2..f9d55da 100644 --- a/functions.lua +++ b/functions.lua @@ -23,3 +23,8 @@ function sneeker.spawn(pos) minetest.add_entity(pos, sneeker.mob_name) sneeker.log_debug('Spawned entity "' .. sneeker.mob_name .. '" at ' .. tostring(pos.x) .. ',' .. tostring(pos.y)) end + +-- Retrieves pos coordinates in string value +function sneeker.get_pos_string(pos) + return 'x=' .. tostring(pos.x) .. ', y=' .. tostring(pos.y) .. ', z=' .. tostring(pos.z) +end diff --git a/spawn.lua b/spawn.lua index 6712354..3841c10 100644 --- a/spawn.lua +++ b/spawn.lua @@ -29,7 +29,7 @@ minetest.register_abm({ local node_light = minetest.get_node_light(pos) -- Debugging spawning - sneeker.log_debug('Node light level at ' .. tostring(pos.x) .. ',' .. tostring(pos.y) .. ': ' .. tostring(node_light)) + sneeker.log_debug('Node light level at ' .. sneeker.get_pos_string(pos) .. ': ' .. tostring(node_light)) if not node_light or node_light > sneeker.spawn_maxlight or node_light < -1 then spawnit = false