forked from mtcontrib/invtweak
Corrige un crash avec les wielders (Fix by Crabman)
This commit is contained in:
parent
e429300d4e
commit
1911b5d160
2
init.lua
2
init.lua
@ -191,6 +191,7 @@ 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()
|
||||||
|
if inv:get_list("main") then
|
||||||
for i,stack in ipairs(inv:get_list("main")) do
|
for i,stack in ipairs(inv:get_list("main")) do
|
||||||
if stack:get_name() == stck_name then
|
if stack:get_name() == stck_name then
|
||||||
inv:set_stack("main", index, stack)
|
inv:set_stack("main", index, stack)
|
||||||
@ -201,6 +202,7 @@ function refill(player, stck_name, index)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if auto_refill == true then
|
if auto_refill == true then
|
||||||
minetest.register_on_placenode(function(pos, newnode, placer, oldnode)
|
minetest.register_on_placenode(function(pos, newnode, placer, oldnode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user