Recipe: Fix a bug

This commit is contained in:
Simon Brodtmann 2025-02-26 19:52:16 +01:00
parent f8c4b94165
commit acd86bfe2b

View file

@ -11,15 +11,14 @@ function Recipe:new(value)
if type(value) == "string" then
name = value
recipe = data.raw.recipe[name]
elseif type(value) == "table" then
name = value.name
recipe = value
end
if not recipe then
log("Recipe not found: " .. name)
return nil
end
elseif type(value) == "table" then
name = value.name
recipe = value
end
local obj = {
prototype = recipe