Skip to content

Commit

Permalink
fix: Fixed the pressure dome breaking "randomly" when supplying wrong…
Browse files Browse the repository at this point in the history
… temperature atmosphere through editor mode infinity pipes.
  • Loading branch information
notnotmelon committed Dec 19, 2024
1 parent c211225 commit 4d0b11f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/pressure-dome.lua
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,22 @@ local function place_regulator(pressure_dome_data)
pressure_dome_data.regulator_fluidbox = regulator_fluidbox
end

-- ensure regulators always have the correct temperature of atmosphere (25 deg C)
maraxsis.on_nth_tick(631, function()
for _, pressure_dome_data in pairs(storage.pressure_domes) do
local regulator_fluidbox = pressure_dome_data.regulator_fluidbox
if not regulator_fluidbox or not regulator_fluidbox.valid then
place_regulator(pressure_dome_data)
end

local fluid = regulator_fluidbox.fluidbox[1]
if fluid and fluid.temperature ~= 25 then
fluid.temperature = 25
regulator_fluidbox.fluidbox[1] = fluid
end
end
end)

maraxsis.on_event(maraxsis.events.on_built(), function(event)
local entity = event.entity
if not entity.valid or entity.name ~= "maraxsis-pressure-dome" then return end
Expand Down

0 comments on commit 4d0b11f

Please sign in to comment.