From 81b1aa3228346ab303a5aee3bbe9cbe898ac9f4b Mon Sep 17 00:00:00 2001 From: x2605 <69812394+x2605@users.noreply.github.com> Date: Fri, 15 Apr 2022 17:57:06 +0900 Subject: [PATCH] Fix "Mods mismatch!" error when overhaul setting is not synced. Conditional "require" context is known as causing that. --- data.lua | 4 +--- scripts/overhaul.lua | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/data.lua b/data.lua index fbae7f5..1bf38fc 100644 --- a/data.lua +++ b/data.lua @@ -122,9 +122,7 @@ if data.raw.technology["atomic-bomb"] then end --overhaul -if settings.startup['overhaul_mode'].value == true then - require('scripts/overhaul') -end +require('scripts/overhaul') --white hole require('scripts/gravitation/gr_make_white_hole_recipes') diff --git a/scripts/overhaul.lua b/scripts/overhaul.lua index 44a717c..176fd25 100644 --- a/scripts/overhaul.lua +++ b/scripts/overhaul.lua @@ -1,3 +1,6 @@ +if settings.startup['overhaul_mode'].value == true then +-- indent ignored + local function add_to_recipe(recipe, item, item_amount) if not data.raw.recipe[recipe] then return @@ -174,4 +177,6 @@ tech_structure = {"tech", "pre_tech"} add_to_recipes(change_table_index(building_table, recipe_structure)) add_to_recipes(change_table_index(item_table, recipe_structure)) -add_to_techs(change_table_index(tech_table, tech_structure)) \ No newline at end of file +add_to_techs(change_table_index(tech_table, tech_structure)) + +end --indent ignored \ No newline at end of file