Drop arrow: put the itemstack back to the inventory only in non-creative mode

This commit is contained in:
upsilon 2017-01-17 19:09:30 +01:00
parent 19f5864d67
commit 2331ccf9b4
1 changed files with 3 additions and 1 deletions

View File

@ -173,7 +173,9 @@ if get_setting("drop_arrow") then
minetest.item_drop(ItemStack(data.itemstack), hitter, last_pos)
end,
on_hit_fails = function(_, thrower, data)
thrower:get_inventory():set_stack("main", data.index, data.itemstack)
if not minetest.setting_getbool("creative_mode") then
thrower:get_inventory():set_stack("main", data.index, data.itemstack)
end
end
})
end