Atualização lib tror
parent
9177ee6b72
commit
90fd477217
14
lib/tror.lua
14
lib/tror.lua
|
@ -134,12 +134,14 @@ tror.trocar_plus = function(player, item_rem, item_add)
|
|||
|
||||
-- Transfere todos os itens ao jogador (e dropa os que nao couberem no inventario)
|
||||
local dropou = false
|
||||
for _,item in ipairs(item_add) do
|
||||
if inv:room_for_item("main", item) then
|
||||
inv:add_item("main", item)
|
||||
else
|
||||
dropou = true
|
||||
minetest.env:add_item({x = pos.x + math.random() * 2 - 1, y = pos.y+1, z = pos.z + math.random() * 2 - 1}, item)
|
||||
if item_add ~= nil then
|
||||
for _,item in ipairs(item_add) do
|
||||
if inv:room_for_item("main", item) then
|
||||
inv:add_item("main", item)
|
||||
else
|
||||
dropou = true
|
||||
minetest.env:add_item({x = pos.x + math.random() * 2 - 1, y = pos.y+1, z = pos.z + math.random() * 2 - 1}, item)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue