mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-23 16:30:19 +01:00
refix bug, if mores items in inv, invtweak refill
This commit is contained in:
parent
1f069ae70f
commit
5fbf422aaf
@ -192,6 +192,8 @@ end
|
|||||||
-- tool break sound + autorefill
|
-- tool break sound + autorefill
|
||||||
function refill(player, stck_name, index)
|
function refill(player, stck_name, index)
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
|
local old_stack = inv:get_stack("main", index)
|
||||||
|
if old_stack:get_name() == stck_name then return end
|
||||||
for i,stack in ipairs(inv:get_list("main")) do
|
for i,stack in ipairs(inv:get_list("main")) do
|
||||||
if i ~= index and stack:get_name() == stck_name then
|
if i ~= index and stack:get_name() == stck_name then
|
||||||
inv:set_stack("main", index, stack)
|
inv:set_stack("main", index, stack)
|
||||||
|
Loading…
Reference in New Issue
Block a user