mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-25 02:00:37 +01:00
[u_inv] Drop when when not enough space in main list
This commit is contained in:
parent
8df39766b4
commit
9eeec0e86e
@ -134,7 +134,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
if not stack then
|
if not stack then
|
||||||
return
|
return
|
||||||
elseif not player:get_inventory():room_for_item("main", stack) then
|
elseif not player:get_inventory():room_for_item("main", stack) then
|
||||||
minetest.chat_send_player(player:get_player_name(), "You need one free slot in your main inventory")
|
local pos = player:getpos()
|
||||||
|
pos.y = pos.y + 2
|
||||||
|
minetest.add_item(pos, stack)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
player:get_inventory():add_item("main", stack)
|
player:get_inventory():add_item("main", stack)
|
||||||
|
Loading…
Reference in New Issue
Block a user