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.
Этот коммит содержится в:
John Cole
2016-07-12 15:49:43 -04:00
коммит произвёл Auke Kok
родитель db93277a98
Коммит 26a5273dd6
5 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -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)