2 Commits

Author SHA1 Message Date
4fa4977478 Tentative de correction d'un crash 2019-02-10 02:22:52 +01:00
1911b5d160 Corrige un crash avec les wielders (Fix by Crabman) 2019-02-08 20:14:04 +01:00

View File

@ -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)
@ -272,6 +274,14 @@ minetest.register_on_dignode(function(pos, oldnode, digger)
if not old and tname == "" then if not old and tname == "" then
old = 0 old = 0
end end
--debug
if not old then
old = 0
print("Debug invtweak: OLD is nil\nplayer is ")
print(name)
print("\nname is ")
print(tname)
end
local new = item:get_wear() local new = item:get_wear()
if old ~= new then if old ~= new then