From 54a7102291c024315483d18d8f4c662fde45ce41 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Sun, 1 Nov 2015 17:54:29 +0100 Subject: Make stairplus:register_* functions work without using register_all. --- circular_saw.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'circular_saw.lua') diff --git a/circular_saw.lua b/circular_saw.lua index 88c6260..c06927f 100644 --- a/circular_saw.lua +++ b/circular_saw.lua @@ -102,9 +102,11 @@ function circular_saw:get_output_inv(modname, material, amount, max) local t = circular_saw.names[i] local cost = circular_saw.cost_in_microblocks[i] local balance = math.min(math.floor(amount/cost), max) - pos = pos + 1 - list[pos] = modname .. ":" .. t[1] .. "_" .. material .. t[2] - .. " " .. balance + local nodename = modname .. ":" .. t[1] .. "_" .. material .. t[2] + if minetest.registered_nodes[nodename] then + pos = pos + 1 + list[pos] = nodename .. " " .. balance + end end return list end -- cgit v1.2.3