diff options
author | John Cole <john@jhcole.com> | 2016-07-12 15:49:43 -0400 |
---|---|---|
committer | Auke Kok <sofar+github@foo-projects.org> | 2016-07-12 12:49:43 -0700 |
commit | 26a5273dd69e99b904880ebc69a2764694db3c41 (patch) | |
tree | 8124e21130164dd2dafeafb3e6f34983dfcf3fc2 | |
parent | db93277a988001bcce2a2d10999897be7b8ee017 (diff) | |
download | moreblocks-26a5273dd69e99b904880ebc69a2764694db3c41.tar.gz moreblocks-26a5273dd69e99b904880ebc69a2764694db3c41.tar.bz2 moreblocks-26a5273dd69e99b904880ebc69a2764694db3c41.zip |
Fix drop logic. (#49)
The code
not type(fields.drop) == "table"
was always false because it compares a boolean with a string,
not (type(fields.drop) == "table")
is the intended logic.
-rw-r--r-- | stairsplus/microblocks.lua | 2 | ||||
-rw-r--r-- | stairsplus/panels.lua | 2 | ||||
-rw-r--r-- | stairsplus/slabs.lua | 2 | ||||
-rw-r--r-- | stairsplus/slopes.lua | 2 | ||||
-rw-r--r-- | stairsplus/stairs.lua | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/stairsplus/microblocks.lua b/stairsplus/microblocks.lua index 7902209..3d5de1f 100644 --- a/stairsplus/microblocks.lua +++ b/stairsplus/microblocks.lua @@ -77,7 +77,7 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields) def.on_place = minetest.rotate_node def.groups = stairsplus:prepare_groups(fields.groups) def.description = desc - if fields.drop and not type(fields.drop) == "table" then + if fields.drop and not (type(fields.drop) == "table") then def.drop = modname.. ":micro_" ..fields.drop..alternate end minetest.register_node(":" ..modname.. ":micro_" ..subname..alternate, def) diff --git a/stairsplus/panels.lua b/stairsplus/panels.lua index dc1d67d..ab6ef83 100644 --- a/stairsplus/panels.lua +++ b/stairsplus/panels.lua @@ -77,7 +77,7 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields) def.on_place = minetest.rotate_node def.description = desc def.groups = stairsplus:prepare_groups(fields.groups) - if fields.drop and not type(fields.drop) == "table" then + if fields.drop and not (type(fields.drop) == "table") then def.drop = modname.. ":panel_" ..fields.drop..alternate end minetest.register_node(":" ..modname.. ":panel_" ..subname..alternate, def) diff --git a/stairsplus/slabs.lua b/stairsplus/slabs.lua index e184981..236d91e 100644 --- a/stairsplus/slabs.lua +++ b/stairsplus/slabs.lua @@ -48,7 +48,7 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields) def.on_place = minetest.rotate_node def.description = ("%s (%d/16)"):format(desc_base, num) def.groups = stairsplus:prepare_groups(fields.groups) - if fields.drop and not type(fields.drop) == "table" then + if fields.drop and not (type(fields.drop) == "table") then def.drop = modname.. ":slab_" .. fields.drop .. alternate end minetest.register_node(":" .. modname .. ":slab_" .. subname .. alternate, def) diff --git a/stairsplus/slopes.lua b/stairsplus/slopes.lua index dfb4bcb..f0e8c20 100644 --- a/stairsplus/slopes.lua +++ b/stairsplus/slopes.lua @@ -231,7 +231,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields) def.on_place = minetest.rotate_node def.description = desc def.groups = stairsplus:prepare_groups(fields.groups) - if fields.drop and not type(fields.drop) == "table" then + if fields.drop and not (type(fields.drop) == "table") then def.drop = modname.. ":slope_" ..fields.drop..alternate end minetest.register_node(":" ..modname.. ":slope_" ..subname..alternate, def) diff --git a/stairsplus/stairs.lua b/stairsplus/stairs.lua index 04b8667..ee8075f 100644 --- a/stairsplus/stairs.lua +++ b/stairsplus/stairs.lua @@ -117,7 +117,7 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields) def.on_place = minetest.rotate_node def.description = desc def.groups = stairsplus:prepare_groups(fields.groups) - if fields.drop and not type(fields.drop) == "table" then + if fields.drop and not (type(fields.drop) == "table") then def.drop = modname .. ":stair_" .. fields.drop .. alternate end minetest.register_node(":" .. modname .. ":stair_" .. subname .. alternate, def) |