diff options
author | Calinou <Calinou@users.noreply.github.com> | 2015-11-06 17:28:01 +0100 |
---|---|---|
committer | Calinou <Calinou@users.noreply.github.com> | 2015-11-06 17:28:01 +0100 |
commit | d3ba90d012de2a6e0f2cff86083ace8ce1766cc4 (patch) | |
tree | c5266d8ad8ef63aaf424b05b3a334d1b02aacd56 /circular_saw.lua | |
parent | f02a871c30c302014dda49c278f62ccaf29dc620 (diff) | |
parent | 54a7102291c024315483d18d8f4c662fde45ce41 (diff) |
Merge pull request #24 from pyrollo/master
Make stairplus:register_* functions work without using register_all.
Diffstat (limited to 'circular_saw.lua')
-rw-r--r-- | circular_saw.lua | 8 |
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 |