Skip to content

Commit ac4bc5a

Browse files
authored
fix: move temperature check in animal_temperature component from enviro signal to life signal
1 parent 3de7181 commit ac4bc5a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

code/datums/components/animal_temperature.dm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@
6565

6666
/datum/component/animal_temperature/RegisterWithParent()
6767
RegisterSignal(parent, COMSIG_ANIMAL_HANDLE_ENVIRONMENT, PROC_REF(handle_environment))
68+
RegisterSignal(parent, COMSIG_LIVING_LIFE, PROC_REF(check_temperature))
6869

6970
/datum/component/animal_temperature/UnregisterFromParent()
70-
UnregisterSignal(parent, COMSIG_ANIMAL_HANDLE_ENVIRONMENT)
71+
UnregisterSignal(parent, list(COMSIG_ANIMAL_HANDLE_ENVIRONMENT, COMSIG_LIVING_LIFE))
7172

7273
/datum/component/animal_temperature/proc/handle_environment(datum/source, datum/gas_mixture/environment)
7374
SIGNAL_HANDLER
7475

7576
var/mob/living/simple_animal/animal = source
7677

7778
INVOKE_ASYNC(src, PROC_REF(regulate_temperature), animal, environment)
78-
INVOKE_ASYNC(src, PROC_REF(check_temperature), animal)
7979

8080
/datum/component/animal_temperature/proc/regulate_temperature(mob/living/simple_animal/animal, datum/gas_mixture/environment)
8181
var/areatemp = animal.get_temperature(environment)
@@ -87,7 +87,9 @@
8787

8888
return
8989

90-
/datum/component/animal_temperature/proc/check_temperature(mob/living/simple_animal/animal)
90+
/datum/component/animal_temperature/proc/check_temperature(mob/living/simple_animal/animal, deltatime, times_fired)
91+
SIGNAL_HANDLER
92+
9193
if(animal.bodytemperature < minbodytemp)
9294
animal.adjustHealth(cold_damage)
9395

0 commit comments

Comments
 (0)