Skip to content

Commit

Permalink
(FIX) Changing fill type will now alter current fill types of machines
Browse files Browse the repository at this point in the history
  • Loading branch information
scfmod committed Jan 8, 2022
1 parent 6cd8992 commit 0e6a7c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/TerraFarm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,16 @@ function TerraFarm:setFillType(name, typeIndex)
return
end

local previousFillType = self.config.fillTypeName
local previousFillTypeIndex = self.config.fillTypeIndex

self.config.fillTypeName = name
self.config.fillTypeIndex = g_fillTypeManager.nameToIndex[self.config.fillTypeName]
self.config.fillTypeMassPerLiter = fillType.massPerLiter * 1000 * 1000

for machine, _ in pairs(self.machineToObject) do
if machine.updateFillType ~= nil then
machine:updateFillType()
machine:updateFillType(previousFillType, previousFillTypeIndex)
end
end

Expand Down

0 comments on commit 0e6a7c6

Please sign in to comment.