forked from mtcontrib/invtweak
Corrige un crash avec les wielders (Fix by Crabman)
This commit is contained in:
parent
e429300d4e
commit
1911b5d160
16
init.lua
16
init.lua
@ -191,13 +191,15 @@ 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()
|
||||||
for i,stack in ipairs(inv:get_list("main")) do
|
if inv:get_list("main") then
|
||||||
if stack:get_name() == stck_name then
|
for i,stack in ipairs(inv:get_list("main")) do
|
||||||
inv:set_stack("main", index, stack)
|
if stack:get_name() == stck_name then
|
||||||
stack:clear()
|
inv:set_stack("main", index, stack)
|
||||||
inv:set_stack("main", i, stack)
|
stack:clear()
|
||||||
minetest.log("action", "Inventory Tweaks: refilled stack("..stck_name..") of " .. player:get_player_name() )
|
inv:set_stack("main", i, stack)
|
||||||
return
|
minetest.log("action", "Inventory Tweaks: refilled stack("..stck_name..") of " .. player:get_player_name() )
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user