From 8415a954dec07f759b4e026ebf2459b52daf1ca7 Mon Sep 17 00:00:00 2001 From: Archie Date: Fri, 25 Jun 2021 21:38:49 -0300 Subject: [PATCH] unregisters --- hyperstation/code/obj/leash.dm | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/hyperstation/code/obj/leash.dm b/hyperstation/code/obj/leash.dm index 8c4008f9..46dcc35c 100644 --- a/hyperstation/code/obj/leash.dm +++ b/hyperstation/code/obj/leash.dm @@ -132,9 +132,12 @@ Icons, maybe? leash_pet.remove_status_effect(/datum/status_effect/leash_pet) if(!leash_pet.has_status_effect(/datum/status_effect/leash_pet)) //If there is no pet, there is no dom. Loop breaks. - QDEL_NULL(mobhook_leash_master) - QDEL_NULL(mobhook_leash_pet) - QDEL_NULL(mobhook_leash_freepet) + //QDEL_NULL(mobhook_leash_master) + UnregisterSignal(mobhook_leash_master, COMSIG_MOVABLE_MOVED) + //QDEL_NULL(mobhook_leash_pet) + UnregisterSignal(mobhook_leash_pet, COMSIG_MOVABLE_MOVED) + //QDEL_NULL(mobhook_leash_freepet) + UnregisterSignal(mobhook_leash_freepet, COMSIG_MOVABLE_MOVED) if(leash_pet.has_status_effect(/datum/status_effect/leash_freepet)) leash_pet.remove_status_effect(/datum/status_effect/leash_freepet) if(leash_pet.has_movespeed_modifier(MOVESPEED_ID_LEASH)) @@ -189,7 +192,8 @@ Icons, maybe? if(leash_pet == leash_master) //Pet is the master return if(!leash_pet.has_status_effect(/datum/status_effect/leash_pet)) - QDEL_NULL(mobhook_leash_master) //Probably redundant, but it's nice to be safe + //QDEL_NULL(mobhook_leash_master) //Probably redundant, but it's nice to be safe + UnregisterSignal(mobhook_leash_master, COMSIG_MOVABLE_MOVED) leash_master.remove_status_effect(/datum/status_effect/leash_dom) return @@ -258,8 +262,10 @@ Icons, maybe? leash_pet.remove_status_effect(/datum/status_effect/leash_pet) leash_pet.remove_movespeed_modifier(MOVESPEED_ID_LEASH) leash_master.remove_status_effect(/datum/status_effect/leash_dom) - QDEL_NULL(mobhook_leash_master) - QDEL_NULL(mobhook_leash_pet) + //QDEL_NULL(mobhook_leash_master) + UnregisterSignal(mobhook_leash_master, COMSIG_MOVABLE_MOVED) + //QDEL_NULL(mobhook_leash_pet) + UnregisterSignal(mobhook_leash_pet, COMSIG_MOVABLE_MOVED) leash_pet = "null" leash_master = "null" leash_used = 0 @@ -273,7 +279,8 @@ Icons, maybe? return //Make sure the pet is still a pet if(!leash_pet.has_status_effect(/datum/status_effect/leash_pet)) - QDEL_NULL(mobhook_leash_pet) //Probably redundant, but it's nice to be safe + //QDEL_NULL(mobhook_leash_pet) //Probably redundant, but it's nice to be safe + UnregisterSignal(mobhook_leash_pet, COMSIG_MOVABLE_MOVED) return //The pet has escaped. There is no DOM. GO PET RUN. @@ -362,8 +369,10 @@ Icons, maybe? leash_pet.adjustOxyLoss(5) leash_pet.remove_status_effect(/datum/status_effect/leash_pet) leash_pet.remove_status_effect(/datum/status_effect/leash_freepet) - QDEL_NULL(mobhook_leash_pet) - QDEL_NULL(mobhook_leash_freepet) + //QDEL_NULL(mobhook_leash_pet) + UnregisterSignal(mobhook_leash_pet, COMSIG_MOVABLE_MOVED) + //QDEL_NULL(mobhook_leash_freepet) + UnregisterSignal(mobhook_leash_freepet, COMSIG_MOVABLE_MOVED) leash_pet = "null" leash_used = 0 @@ -386,7 +395,8 @@ Icons, maybe? mobhook_leash_freepet = leash_pet leash_master.remove_status_effect(/datum/status_effect/leash_dom) //No dom with no leash. We will get a new dom if the leash is picked back up. leash_master = "null" - QDEL_NULL(mobhook_leash_master) + //QDEL_NULL(mobhook_leash_master) + UnregisterSignal(mobhook_leash_master, COMSIG_MOVABLE_MOVED) /obj/item/leash/equipped(mob/user) . = ..() @@ -404,7 +414,8 @@ Icons, maybe? RegisterSignal(leash_master, COMSIG_MOVABLE_MOVED, .proc/on_master_move) mobhook_leash_master = leash_master leash_pet.remove_status_effect(/datum/status_effect/leash_freepet) - QDEL_NULL(mobhook_leash_freepet) + //QDEL_NULL(mobhook_leash_freepet) + UnregisterSignal(mobhook_leash_freepet, COMSIG_MOVABLE_MOVED) leash_pet.add_movespeed_modifier(MOVESPEED_ID_LEASH, multiplicative_slowdown = 5) /datum/crafting_recipe/leash