From 4dbd799477ad788ae3852738f0b9322c35f6607a Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 28 Feb 2025 09:41:22 +0100 Subject: [PATCH] Fix crash due to nil value in recipe ingredients --- lignumis/info.json | 2 +- lignumis/prototypes/content/basic-construction-robots.lua | 6 +++--- lignumis/prototypes/content/lumber-mill.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lignumis/info.json b/lignumis/info.json index 2ed24b9..4d756e2 100644 --- a/lignumis/info.json +++ b/lignumis/info.json @@ -12,7 +12,7 @@ "flib", "PlanetsLib >= 1.1.26", "astroponics >= 1.2.0", - "cf-lib >= 0.0.5", + "cf-lib >= 0.0.8", "mf-core >= 1.0.3", "mf-buildings >= 1.0.7", "mf-logistics >= 1.0.1", diff --git a/lignumis/prototypes/content/basic-construction-robots.lua b/lignumis/prototypes/content/basic-construction-robots.lua index 5f54a76..e3c4866 100644 --- a/lignumis/prototypes/content/basic-construction-robots.lua +++ b/lignumis/prototypes/content/basic-construction-robots.lua @@ -42,7 +42,7 @@ local function robot_recipe(color, ingredients) name = "basic-construction-robot-" .. color, enabled = false, energy_required = 10, - ingredients = ingredients, + ingredients = table.trim(ingredients), results = { { type = "item", name = "basic-construction-robot-" .. color, amount = 1 } } } end @@ -111,7 +111,7 @@ local function generator_recipe(color, ingredients) name = "basic-portable-generator-equipment-" .. color, enabled = false, energy_required = 10, - ingredients = ingredients, + ingredients = table.trim(ingredients), results = { { type = "item", name = "basic-portable-generator-equipment-" .. color, amount = 1 } } } end @@ -149,7 +149,7 @@ local function roboport_recipe(color, ingredients) name = "basic-personal-roboport-equipment-" .. color, enabled = false, energy_required = 10, - ingredients = ingredients, + ingredients = table.trim(ingredients), results = { { type = "item", name = "basic-personal-roboport-equipment-" .. color, amount = 1 } } } end diff --git a/lignumis/prototypes/content/lumber-mill.lua b/lignumis/prototypes/content/lumber-mill.lua index cb766db..1d2f6ff 100644 --- a/lignumis/prototypes/content/lumber-mill.lua +++ b/lignumis/prototypes/content/lumber-mill.lua @@ -28,14 +28,14 @@ local lumber_mill_item = LumberMill.ItemBuilder:new() }) LumberMill.RecipeBuilder:new() - :ingredients({ + :ingredients(table.trim({ { type = "item", name = "stone-brick", amount = 40 }, { type = "item", name = "lumber", amount = 100 }, { type = "item", name = "wooden-gear-wheel", amount = 100 }, { type = "item", name = "gold-plate", amount = basic_circuit_board and 30 or 60 }, basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 30 } or nil, { type = "item", name = "burner-assembling-machine", amount = 5 } - }) + })) :apply({ category = "wood-processing-or-assembling" })