-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Jelmergu/feature/fix-burner-assembling-crash
Feature/fix burner assembling crash
- Loading branch information
Showing
6 changed files
with
31 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ function var_dump(table) | |
if data ~= nil then -- during data stage | ||
log(serpent.block(table)) | ||
end | ||
end | ||
end |
22 changes: 10 additions & 12 deletions
22
upgrade-machines/migrations/2020-10-31_upgrade_machines_1.0.0.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters