This commit is contained in:
Alexsandro Percy 2022-03-23 20:20:46 -03:00
parent 4904a7771d
commit 6babb3e907

View File

@ -85,6 +85,7 @@ end
function automobiles_lib.remove_inventory(self) function automobiles_lib.remove_inventory(self)
local inventory = automobiles_lib.get_inventory(self) local inventory = automobiles_lib.get_inventory(self)
if inventory then
if inventory:is_empty("main") then if inventory:is_empty("main") then
return minetest.remove_detached_inventory(self._inv_id) return minetest.remove_detached_inventory(self._inv_id)
else else
@ -103,6 +104,7 @@ function automobiles_lib.remove_inventory(self)
end end
return minetest.remove_detached_inventory(self._inv_id) return minetest.remove_detached_inventory(self._inv_id)
end end
end
return false return false
end end