Skip to content

Commit

Permalink
Organs no longer decay when below freezing temperatures (#4056)
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy authored Nov 7, 2024
1 parent 5f4a718 commit 89e004c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion code/modules/surgery/organs/organ_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,18 @@
return
if(HAS_TRAIT(src, TRAIT_NO_ORGAN_DECAY) || (owner && HAS_TRAIT(owner, TRAIT_NO_ORGAN_DECAY)))
return
apply_organ_damage(decay_factor * maxHealth * seconds_per_tick)
var/air_temperature_factor = 1
if(owner)
if(owner.bodytemperature <= T0C)
return
air_temperature_factor = min((owner.bodytemperature - T0C) / 20, 1)
else
var/datum/gas_mixture/exposed_air = return_air()
if(exposed_air)
if(exposed_air.temperature <= T0C)
return
air_temperature_factor = min((exposed_air.temperature - T0C) / 20, 1)
apply_organ_damage(decay_factor * maxHealth * seconds_per_tick * air_temperature_factor)

/// Called once every life tick on every organ in a carbon's body
/// NOTE: THIS IS VERY HOT. Be careful what you put in here
Expand Down

0 comments on commit 89e004c

Please sign in to comment.