Merge pull request #15282 from Putnam3145/fix-heat-exchangers

Properly implements hysteresis on heat exchanger processing
This commit is contained in:
Lin
2021-10-19 16:53:40 -07:00
committed by GitHub

View File

@@ -12,6 +12,8 @@
var/obj/machinery/atmospherics/components/unary/heat_exchanger/partner = null
var/update_cycle
var/old_temperature = 0
var/other_old_temperature = 0
pipe_state = "heunary"
@@ -59,9 +61,6 @@
var/other_air_heat_capacity = partner_air_contents.heat_capacity()
var/combined_heat_capacity = other_air_heat_capacity + air_heat_capacity
var/old_temperature = air_contents.return_temperature()
var/other_old_temperature = partner_air_contents.return_temperature()
if(combined_heat_capacity > 0)
var/combined_energy = partner_air_contents.return_temperature()*other_air_heat_capacity + air_heat_capacity*air_contents.return_temperature()
@@ -71,6 +70,8 @@
if(abs(old_temperature-air_contents.return_temperature()) > 1)
update_parents()
old_temperature = air_contents.return_temperature()
if(abs(other_old_temperature-partner_air_contents.return_temperature()) > 1)
partner.update_parents()
other_old_temperature = partner_air_contents.return_temperature()