Skip to content

Commit

Permalink
fix: supply level / residential science requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
bahrmichael committed Dec 14, 2023
1 parent b6f5aef commit d53e075
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
---------------------------------------------------------------------------------------------------
Version: 0.3.2
Date: 14. 12. 2023
Changes:
- Reverted the additional need for chemical science packs for researching residential housing.
Bugfixes:
- Fixed an issue where the cities overview would falsely show "lacking" when everything's well supplied.
---------------------------------------------------------------------------------------------------
Version: 0.3.1
Date: 11. 12. 2023
Bugfixes:
Expand Down
2 changes: 1 addition & 1 deletion consumption.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ local function getBasicNeedsSupplyLevels(city, needs)
end
else
local supplyLevel = amounts.provided / amounts.required
table.insert(supplyLevels, supplyLevel)
table.insert(supplyLevels, math.min(supplyLevel, 1))
end
end

Expand Down
6 changes: 3 additions & 3 deletions gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,13 @@ local function getOverallSupplyLevelsSummary(city)
local residentialLevels = Consumption.getBasicNeedsSupplyLevels(city, getNeeds(city, "residential"))
local highriseLevels = Consumption.getBasicNeedsSupplyLevels(city, getNeeds(city, "highrise"))

local supplyLevelSummary = getSupplyLevelsSummary(simpleLevels)
local simpleLevelSummary = getSupplyLevelsSummary(simpleLevels)
local residentialLevelSummary = game.forces.player.technologies["tycoon-residential-housing"].researched and getSupplyLevelsSummary(residentialLevels) or "supplied"
local highriseLevelSymmary = game.forces.player.technologies["tycoon-highrise-housing"].researched and getSupplyLevelsSummary(highriseLevels) or "supplied"

if supplyLevelSummary == "supplied" and residentialLevelSummary == "supplied" and highriseLevelSymmary == "supplied" then
if simpleLevelSummary == "supplied" and residentialLevelSummary == "supplied" and highriseLevelSymmary == "supplied" then
return "supplied"
elseif supplyLevelSummary == "missing" and residentialLevelSummary == "missing" and highriseLevelSymmary == "missing" then
elseif simpleLevelSummary == "missing" and residentialLevelSummary == "missing" and highriseLevelSymmary == "missing" then
return "missing"
else
return "lacking"
Expand Down
1 change: 0 additions & 1 deletion prototypes/technologies/tech.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ data:extend{
ingredients = {
{ "automation-science-pack", 1 },
{ "logistic-science-pack", 1 },
{ "chemical-science-pack", 1 },
},
time = 30,
},
Expand Down

0 comments on commit d53e075

Please sign in to comment.