From 3cd0cdf27fd8dcca0a62a128d473fa345766db69 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 23 Aug 2014 10:52:57 -0400 Subject: [PATCH] Fixes freezers never quite reaching their thermostat temperature --- code/ATMOSPHERICS/components/unary/cold_sink.dm | 2 +- code/ZAS/_gas_mixture_xgm.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ATMOSPHERICS/components/unary/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm index d49de4adf2..2534dc17a1 100644 --- a/code/ATMOSPHERICS/components/unary/cold_sink.dm +++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm @@ -119,7 +119,7 @@ cooling = 1 update_use_power(2) - var/heat_transfer = min(abs(air_contents.get_thermal_energy_change(set_temperature)), active_power_usage) + var/heat_transfer = min(abs(air_contents.get_thermal_energy_change(set_temperature - 5)), active_power_usage) //Assume the heat is being pumped into the hull which is fixed at heatsink_temperature //not /really/ proper thermodynamics but whatever diff --git a/code/ZAS/_gas_mixture_xgm.dm b/code/ZAS/_gas_mixture_xgm.dm index 1f31cc6e96..06f7e0d70a 100644 --- a/code/ZAS/_gas_mixture_xgm.dm +++ b/code/ZAS/_gas_mixture_xgm.dm @@ -112,7 +112,7 @@ //Returns the thermal energy change required to get to a new temperature /datum/gas_mixture/proc/get_thermal_energy_change(var/new_temperature) - return heat_capacity()*(new_temperature - temperature) + return heat_capacity()*(max(new_temperature, 0) - temperature) //Technically vacuum doesn't have a specific entropy. Just use a really big number (infinity would be ideal) here so that it's easy to add gas to vacuum and hard to take gas out. #define SPECIFIC_ENTROPY_VACUUM 150000