Merge pull request #93 from tacigar/tacigar/item_bug

Fix item use bug
This commit is contained in:
tacigar 2016-12-21 20:39:29 +09:00 committed by GitHub
commit 4e2074221c
1 changed files with 2 additions and 1 deletions

View File

@ -263,9 +263,10 @@ function maidroid.register_egg(egg_name, def)
inventory_image = def.inventory_image,
stack_max = 1,
on_use = function(item_stack, user, pointed_thing)
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.above ~= nil and def.product_name ~= nil then
minetest.add_entity(pointed_thing.above, def.product_name)
itemstack:take_item()
return itemstack
end
return nil