diff --git a/cf-lib/data/Recipe.lua b/cf-lib/data/Recipe.lua index 17ba8c0..52e453b 100644 --- a/cf-lib/data/Recipe.lua +++ b/cf-lib/data/Recipe.lua @@ -11,16 +11,15 @@ function Recipe:new(value) if type(value) == "string" then name = value recipe = data.raw.recipe[name] + if not recipe then + log("Recipe not found: " .. name) + return nil + end elseif type(value) == "table" then name = value.name recipe = value end - if not recipe then - log("Recipe not found: " .. name) - return nil - end - local obj = { prototype = recipe } @@ -150,4 +149,4 @@ function Recipe:clone(name) return Recipe:new(clone) end -return Recipe \ No newline at end of file +return Recipe