fix crash from bad digiline msg (#144)

This commit is contained in:
tour 2024-12-02 02:00:02 +01:00 committed by GitHub
parent dcc62eb231
commit dd660c3c1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -598,11 +598,12 @@ minetest.register_node("pipeworks:autocrafter", {
if #msg < 3 then return end
local inv = meta:get_inventory()
for y = 0, 2, 1 do
local row = msg[y + 1]
for x = 1, 3, 1 do
local slot = y * 3 + x
if minetest.registered_items[msg[y + 1][x]] then
if type(row) == "table" and minetest.registered_items[row[x]] then
inv:set_stack("recipe", slot, ItemStack(
msg[y + 1][x]))
row[x]))
else
inv:set_stack("recipe", slot, ItemStack(""))
end