Refactored deletion observables to use the COMSIG_QDELETING signal (#20121)

Refactored deletion observables to use the COMSIG_QDELETING signal
instead, removed the observable.
This commit is contained in:
Fluffy
2024-11-04 22:51:18 +01:00
committed by GitHub
parent ce0f722f18
commit 513facdb0d
25 changed files with 120 additions and 56 deletions
+3 -3
View File
@@ -260,7 +260,7 @@
var/mob/S = new mob_type(T)
animals += S
GLOB.death_event.register(S, src, PROC_REF(remove_animal))
GLOB.destroyed_event.register(S, src, PROC_REF(remove_animal))
RegisterSignal(S, COMSIG_QDELETING, PROC_REF(remove_animal))
adapt_animal(S)
if(animals.len >= max_animal_count)
repopulating = 0
@@ -279,10 +279,10 @@
daddy.group_multiplier = Z.air.group_multiplier
Z.air.equalize(daddy)
/obj/effect/overmap/visitable/sector/exoplanet/proc/remove_animal(var/mob/M)
/obj/effect/overmap/visitable/sector/exoplanet/proc/remove_animal(mob/M)
animals -= M
GLOB.death_event.unregister(M, src)
GLOB.destroyed_event.unregister(M, src)
UnregisterSignal(M, COMSIG_QDELETING)
repopulate_types |= M.type
/obj/effect/overmap/visitable/sector/exoplanet/proc/generate_map()