Optimize Cryoplanet Subsystem (#19490)

* optimize

* cleanup

* use this instead
This commit is contained in:
Will
2026-05-26 19:11:27 -04:00
committed by GitHub
parent 7a025701ed
commit 6e3fe5de0f
3 changed files with 22 additions and 9 deletions
+8 -9
View File
@@ -62,15 +62,14 @@ SUBSYSTEM_DEF(cryoplanets)
neededEnergy = max(neededEnergy, -max_thermal_change)
// Check if this would be affected by the station mainboiler's radiators.
var/area/check_area = get_area(T) // If we have an active radiator in the area, then there is no point in starting a temperature war....
if(check_area && length(SSstationheater.radiators) && target_temp < SSstationheater.target_heat_temperature)
var/obj/structure/stationboiler/current_heater = SSstationheater.get_current_boiler()
if(current_heater?.is_heating()) // If the current boiler isn't on... It won't matter.
for(var/obj/machinery/stationboiler_radiator/radiator in SSstationheater.radiators)
CHECK_TICK
if(get_area(radiator) != check_area)
continue
return // Area had an active radiator, we'll drop out!
// If we have an active radiator in the area, then there is no point in starting a temperature war....
var/area/check_area = get_area(T)
if(check_area && length(check_area.radiators) && target_temp < SSstationheater.target_heat_temperature)
var/obj/machinery/stationboiler_radiator/check_rad = check_area.radiators[1] // It won't matter which radiator in the area, as they're all on the same planet anyway
if(check_rad.get_radiating())
return
// Time to chill the area...
//testing("Energy: [neededEnergy]")
currentAir.add_thermal_energy(neededEnergy)