Skip to content

Commit

Permalink
Merge pull request #4 from Jelmergu/feature/fix-burner-assembling-crash
Browse files Browse the repository at this point in the history
Feature/fix burner assembling crash
  • Loading branch information
Jelmergu authored Oct 31, 2022
2 parents e0a195e + a7adff5 commit 5996a2e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 19 deletions.
12 changes: 11 additions & 1 deletion upgrade-machines/changelog.txt
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -126,4 +136,4 @@ Date: 08. 10. 2017
- Stone to steel furnace
- Steel to electric furnace
- Burner to electric inserter
- Burner to electric drill
- Burner to electric drill
6 changes: 5 additions & 1 deletion upgrade-machines/data-final-fixes.lua
Original file line number Diff line number Diff line change
@@ -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 },
Expand Down
6 changes: 3 additions & 3 deletions upgrade-machines/info.json
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"
}
}
2 changes: 1 addition & 1 deletion upgrade-machines/lib/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 upgrade-machines/migrations/2020-10-31_upgrade_machines_1.0.0.lua
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
2 changes: 1 addition & 1 deletion upgrade-machines/prototypes/recipes/vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Jelmergu:addRecipe(
{
name = "shotgun-to-combat-shotgun",
ingredients = {
{ "pistol", 1 },
{ "shotgun", 1 },
{ "steel-plate", 14 },
},
result = "combat-shotgun",
Expand Down

0 comments on commit 5996a2e

Please sign in to comment.