aboutsummaryrefslogtreecommitdiff
path: root/circular_saw.lua
diff options
context:
space:
mode:
authorPierre-Yves Rollo <dev@pyrollo.com>2015-11-01 17:54:29 +0100
committerPierre-Yves Rollo <dev@pyrollo.com>2015-11-01 17:54:29 +0100
commit54a7102291c024315483d18d8f4c662fde45ce41 (patch)
treec5266d8ad8ef63aaf424b05b3a334d1b02aacd56 /circular_saw.lua
parentf02a871c30c302014dda49c278f62ccaf29dc620 (diff)
downloadmoreblocks-54a7102291c024315483d18d8f4c662fde45ce41.tar.gz
moreblocks-54a7102291c024315483d18d8f4c662fde45ce41.tar.bz2
moreblocks-54a7102291c024315483d18d8f4c662fde45ce41.zip
Make stairplus:register_* functions work without using register_all.
Diffstat (limited to 'circular_saw.lua')
-rw-r--r--circular_saw.lua8
1 files changed, 5 insertions, 3 deletions
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