From a354411b4b7c9c237ee544b4b0f0167ffc1e7f93 Mon Sep 17 00:00:00 2001 From: Brevven Date: Mon, 31 Jan 2022 02:22:55 -0800 Subject: [PATCH] fix when mods missing --- changelog.txt | 1 + refractory-updates.lua | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/changelog.txt b/changelog.txt index ced7aa5..80ffb59 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Date: 2022-01-31 - Fix default setting for refractory recipes. WARNING: If you use these recipes, update your refractory recipes setting before saving your game. + - Fix some refractory recipes when used without certain mods --------------------------------------------------------------------------------------------------- Version: 0.0.9 Date: 2022-01-25 diff --git a/refractory-updates.lua b/refractory-updates.lua index e651416..39a2c87 100644 --- a/refractory-updates.lua +++ b/refractory-updates.lua @@ -93,13 +93,19 @@ function make_recipe(recipe) r.category = "founding" r.subgroup = data.raw.item[found_result].subgroup icons = rusty_icons.of(data.raw.recipe[recipe.name]) - table.insert(icons, - mods.bzcarbon and - { icon = "__bzcarbon__/graphics/icons/graphite-2.png", - icon_size = 128, scale=0.125, shift={8, -8}} - or - { icon = "__bzsilicon__/graphics/icons/silica.png", - icon_size = 64, scale=0.25, icon_mipmaps = 3, shift={8, -8}}) + table.insert( + icons, + (mods.bzcarbon and + { icon = "__bzcarbon__/graphics/icons/graphite-2.png", + icon_size = 128, scale=0.125, shift={8, -8}}) + or (mods.bzsilicon and + { icon = "__bzsilicon__/graphics/icons/silica.png", + icon_size = 64, scale=0.25, icon_mipmaps = 3, shift={8, -8}}) + or (mods.bzzirconium and + { icon = "__bzzirconium__/graphics/icons/zirconia.png", + icon_size = 128, scale=0.125, icon_mipmaps = 3, shift={8, -8}}) + or nil + ) r.icons = icons locale = rusty_locale.of_recipe(data.raw.recipe[recipe.name]) r.localised_name = {"recipe-name.with-refractory", locale.name}