forked from VoxeLibre/VoxeLibre
try to fix give function
This commit is contained in:
parent
d00490c86f
commit
64b49ba719
|
@ -4,9 +4,9 @@ mcl_cauldrons = {}
|
|||
-- Cauldron mod, adds cauldrons.
|
||||
|
||||
local function give_item(user, itemstack)
|
||||
if itemstack and user:is_player() then
|
||||
local inv = user:get_inventory()
|
||||
if false then --minetest.is_creative_enabled(user:get_player_name()) then
|
||||
local inv = user:get_inventory()
|
||||
if inv then
|
||||
--[[if false then --minetest.is_creative_enabled(user:get_player_name()) then
|
||||
if inv:contains_item("main", itemstack) then
|
||||
return false
|
||||
else
|
||||
|
@ -16,13 +16,13 @@ local function give_item(user, itemstack)
|
|||
minetest.add_item(user:get_pos(), itemstack)
|
||||
end
|
||||
end
|
||||
else]]
|
||||
if inv:room_for_item("main", itemstack) then
|
||||
inv:add_item("main", itemstack)
|
||||
else
|
||||
if inv:room_for_item("main", itemstack) then
|
||||
inv:add_item("main", itemstack)
|
||||
else
|
||||
minetest.add_item(user:get_pos(), itemstack)
|
||||
end
|
||||
minetest.add_item(user:get_pos(), itemstack)
|
||||
end
|
||||
--end
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue