From 0873404f944b99a8b0276fcb7f30d7ad81c8a71e Mon Sep 17 00:00:00 2001 From: Brevven Date: Sat, 22 Oct 2022 20:30:32 -0700 Subject: [PATCH] up --- data-util.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/data-util.lua b/data-util.lua index cd2148a..3373bb2 100644 --- a/data-util.lua +++ b/data-util.lua @@ -235,6 +235,18 @@ function util.se_matter(params) end end +-- Get the normal prototype for a recipe -- either .normal or the recipe itself +function util.get_normal(recipe_name) + if data.raw.recipe[recipe_name] then + recipe = data.raw.recipe[recipe_name] + if recipe.normal and recipe.normal.ingredients then + return recipe.normal + elseif recipe.ingredients then + return recipe + end + end +end + -- Set/override a technology's prerequisites function util.set_prerequisite(technology_name, prerequisites) local technology = data.raw.technology[technology_name]