diff --git a/upgrade-machines/changelog.txt b/upgrade-machines/changelog.txt index ecfe5bc..60daf8a 100644 --- a/upgrade-machines/changelog.txt +++ b/upgrade-machines/changelog.txt @@ -1,4 +1,14 @@ --------------------------------------------------------------------------------------------------- +Version: 1.1.0 +Date: 12. 01. 2021 + Bug fix: + - Fix that Burner Assembling to Assembling machine 1 created a crash on load +--------------------------------------------------------------------------------------------------- +Version: 1.1.0 +Date: 12. 01. 2021 + General: + - Update for 1.1 +--------------------------------------------------------------------------------------------------- Version: 1.0.0 Date: 31. 10. 2020 General: @@ -126,4 +136,4 @@ Date: 08. 10. 2017 - Stone to steel furnace - Steel to electric furnace - Burner to electric inserter - - Burner to electric drill \ No newline at end of file + - Burner to electric drill diff --git a/upgrade-machines/data-final-fixes.lua b/upgrade-machines/data-final-fixes.lua index e6b8b1d..e23bea3 100644 --- a/upgrade-machines/data-final-fixes.lua +++ b/upgrade-machines/data-final-fixes.lua @@ -1,14 +1,18 @@ -if data.raw.recipe["basic-circuit-board"] then +if data.raw.recipe["basic-circuit-board"] and data.raw.recipe["burner-to-electric-inserter"] then data.raw.recipe["burner-to-electric-inserter"].ingredients = { { "basic-circuit-board", 1 }, { "burner-inserter", 1 } } +end +if data.raw.recipe["basic-circuit-board"] and data.raw.recipe["burner-to-electric-drill"] then data.raw.recipe["burner-to-electric-drill"].normal.ingredients = { { "burner-mining-drill", 1 }, { "iron-gear-wheel", 2 }, { "iron-plate", 7 }, { "basic-circuit-board", 3}, } +end +if data.raw.recipe["basic-circuit-board"] and data.raw.recipe["burner-assembling-to-assembling-machine-1"] then data.raw.recipe["burner-assembling-to-assembling-machine-1"].ingredients = { { "burner-assembling-machine", 1 }, { "basic-circuit-board", 3 }, diff --git a/upgrade-machines/info.json b/upgrade-machines/info.json index af3fb4f..584bc03 100644 --- a/upgrade-machines/info.json +++ b/upgrade-machines/info.json @@ -1,11 +1,11 @@ { "name": "upgrade-machines", - "version": "1.0.0", + "version": "1.1.1", "title": "Upgrade Machines", "author": "Jelmergu", "contact": "", "homepage": "", - "factorio_version": "1.0", + "factorio_version": "1.1", "dependencies": ["base >= 0.16.22", "? bobelectronics >= 0.15.2", "? bobplates >= 0.15.12"], "description": "This mod adds recipes to upgrade all burner stage machines to their next tier machine" -} \ No newline at end of file +} diff --git a/upgrade-machines/lib/helpers.lua b/upgrade-machines/lib/helpers.lua index 33abff6..7f15cd7 100644 --- a/upgrade-machines/lib/helpers.lua +++ b/upgrade-machines/lib/helpers.lua @@ -40,4 +40,4 @@ function var_dump(table) if data ~= nil then -- during data stage log(serpent.block(table)) end -end \ No newline at end of file +end diff --git a/upgrade-machines/migrations/2020-10-31_upgrade_machines_1.0.0.lua b/upgrade-machines/migrations/2020-10-31_upgrade_machines_1.0.0.lua index 41937d9..0a60931 100644 --- a/upgrade-machines/migrations/2020-10-31_upgrade_machines_1.0.0.lua +++ b/upgrade-machines/migrations/2020-10-31_upgrade_machines_1.0.0.lua @@ -1,14 +1,12 @@ -for _, force in pairs(game.forces) do - if force.technologies["bob-steam-turbine-1"].researched == true then - force.recipes["steam-engine-to-steam-turbine"].enabled = false - force.recipes["steam-engine-to-steam-turbine"].reload() - end - if force.technologies["bob-heat-exchanger-1"].researched == true then - force.recipes["boiler-to-heat-exchanger"].enabled = false - force.recipes["boiler-to-heat-exchanger"].reload() - end - if force.technologies["automation"].researched == true then - force.recipes["burner-assembling-to-assembling-machine-1"].enabled = true - force.recipes["burner-assembling-to-assembling-machine-1"].reload() +function enable_recipe_if_tech_exists(force, tech, recipe) + if force.technologies[tech] ~= nil and force.recipes[recipe] ~= nil and force.technologies[tech].researched == true then + force.recipes[recipe].enabled = false + force.recipes[recipe].reload() end +end + +for _, force in pairs(game.forces) do + enable_recipe_if_tech_exists(force, "bob-steam-turbine-1", "steam-engine-to-steam-turbine") + enable_recipe_if_tech_exists(force, "bob-heat-exchanger-1", "boiler-to-heat-exchanger") + enable_recipe_if_tech_exists(force, "automation", "burner-assembling-to-assembling-machine-1") end \ No newline at end of file diff --git a/upgrade-machines/prototypes/recipes/vanilla.lua b/upgrade-machines/prototypes/recipes/vanilla.lua index b2147f9..d16c239 100644 --- a/upgrade-machines/prototypes/recipes/vanilla.lua +++ b/upgrade-machines/prototypes/recipes/vanilla.lua @@ -108,7 +108,7 @@ Jelmergu:addRecipe( { name = "shotgun-to-combat-shotgun", ingredients = { - { "pistol", 1 }, + { "shotgun", 1 }, { "steel-plate", 14 }, }, result = "combat-shotgun",