mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
[MIRROR] Small Crystallizer Fixes (#5166)
* Small Crystallizer Fixes (#58614) fix: fixed crystallizer locking up when the input port is devoid of proper gases. fix: fixed crystallizer conducting heat with the heat loop only on reactions. It should conduct at all times now. * Small Crystallizer Fixes Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com>
This commit is contained in:
+17
-15
@@ -131,17 +131,6 @@
|
||||
|
||||
///Calculation for the heat of the various gas mixes and controls the quality of the item
|
||||
/obj/machinery/atmospherics/components/binary/crystallizer/proc/heat_calculations()
|
||||
var/datum/gas_mixture/cooling_port = airs[1]
|
||||
if(cooling_port.total_moles() > MINIMUM_MOLE_COUNT)
|
||||
if(internal.total_moles() > 0)
|
||||
var/coolant_temperature_delta = cooling_port.temperature - internal.temperature
|
||||
var/cooling_heat_capacity = cooling_port.heat_capacity()
|
||||
var/internal_heat_capacity = internal.heat_capacity()
|
||||
var/cooling_heat_amount = HIGH_CONDUCTIVITY_RATIO * coolant_temperature_delta * (cooling_heat_capacity * internal_heat_capacity / (cooling_heat_capacity + internal_heat_capacity))
|
||||
cooling_port.temperature = max(cooling_port.temperature - cooling_heat_amount / cooling_heat_capacity, TCMB)
|
||||
internal.temperature = max(internal.temperature + cooling_heat_amount / internal_heat_capacity, TCMB)
|
||||
update_parents()
|
||||
|
||||
if( (internal.temperature >= (selected_recipe.min_temp * MIN_DEVIATION_RATE) && internal.temperature <= selected_recipe.min_temp) || \
|
||||
(internal.temperature >= selected_recipe.max_temp && internal.temperature <= (selected_recipe.max_temp * MAX_DEVIATION_RATE)))
|
||||
quality_loss = min(quality_loss + 1.5, 100)
|
||||
@@ -155,6 +144,19 @@
|
||||
else if(selected_recipe.reaction_type == "exothermic")
|
||||
internal.temperature = max(internal.temperature + (selected_recipe.energy_release / internal.heat_capacity()), TCMB)
|
||||
|
||||
///Conduction between the internal gasmix and the moderating (cooling/heating) gasmix.
|
||||
/obj/machinery/atmospherics/components/binary/crystallizer/proc/heat_conduction()
|
||||
var/datum/gas_mixture/cooling_port = airs[1]
|
||||
if(cooling_port.total_moles() > MINIMUM_MOLE_COUNT)
|
||||
if(internal.total_moles() > 0)
|
||||
var/coolant_temperature_delta = cooling_port.temperature - internal.temperature
|
||||
var/cooling_heat_capacity = cooling_port.heat_capacity()
|
||||
var/internal_heat_capacity = internal.heat_capacity()
|
||||
var/cooling_heat_amount = HIGH_CONDUCTIVITY_RATIO * coolant_temperature_delta * (cooling_heat_capacity * internal_heat_capacity / (cooling_heat_capacity + internal_heat_capacity))
|
||||
cooling_port.temperature = max(cooling_port.temperature - cooling_heat_amount / cooling_heat_capacity, TCMB)
|
||||
internal.temperature = max(internal.temperature + cooling_heat_amount / internal_heat_capacity, TCMB)
|
||||
update_parents()
|
||||
|
||||
///Calculate the total moles needed for the recipe
|
||||
/obj/machinery/atmospherics/components/binary/crystallizer/proc/moles_calculations()
|
||||
var/amounts = 0
|
||||
@@ -172,15 +174,15 @@
|
||||
if(!on || !is_operational || selected_recipe == null)
|
||||
return
|
||||
|
||||
if(!check_gas_requirements())
|
||||
return
|
||||
|
||||
inject_gases()
|
||||
if(check_gas_requirements())
|
||||
inject_gases()
|
||||
|
||||
if(!internal.total_moles())
|
||||
update_parents()
|
||||
return
|
||||
|
||||
heat_conduction()
|
||||
|
||||
if(internal_check())
|
||||
if(check_temp_requirements())
|
||||
heat_calculations()
|
||||
|
||||
Reference in New Issue
Block a user