Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed migration for swamp farming 2 technology
- Loading branch information
1 parent
adea1f1
commit ebb6a38
Showing
3 changed files
with
32 additions
and
1 deletion.
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
30 changes: 30 additions & 0 deletions
30
angelsbioprocessing/migrations/angelsbioprocessing_0.7.11.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
game.reload_script() | ||
|
||
--Enable recipes | ||
for index, force in pairs(game.forces) do | ||
force.reset_recipes() | ||
force.reset_technologies() | ||
force.reset_technology_effects() | ||
|
||
local researched = false | ||
for _, techName in pairs{ | ||
"bio-arboretum-2", | ||
"bio-arboretum-desert-2", | ||
"bio-arboretum-temperate-2", | ||
"bio-arboretum-swamp-2", | ||
"bio-desert-farm", | ||
"bio-temperate-farm", | ||
"bio-swamp-farm", | ||
} do | ||
if (force.technologies[techName] or {}).researched then | ||
for techToResearch, techToCheck in pairs{ | ||
["bio-swamp-farming-2"] = "bio-swamp-farming-1", | ||
} do | ||
if force.technologies[techToResearch] and force.technologies[techToCheck] then | ||
force.technologies[techToResearch].researched = force.technologies[techToCheck].researched or force.technologies[techToResearch].researched | ||
end | ||
end | ||
break | ||
end | ||
end | ||
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