From c32c6fc98b2f919e2da5b91ab29f5c848961002f Mon Sep 17 00:00:00 2001 From: adrian Date: Mon, 28 Oct 2019 13:29:44 -0300 Subject: [PATCH] Fixes simple_animals not deleting properly (#24618) * Fixes simple_animals not deleting properly * Merging both /mob/living/New() --- code/modules/mob/living/living.dm | 23 +++++++++---------- .../mob/living/simple_animal/simple_animal.dm | 4 ---- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 4b28644c647..56e2cac635f 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -18,6 +18,9 @@ immune_system = new (src) + on_resist = new(owner = src) + on_life = new(owner = src) + /mob/living/Destroy() for(var/mob/living/silicon/robot/mommi/MoMMI in player_list) for(var/image/I in static_overlays) @@ -42,6 +45,14 @@ qdel(immune_system) immune_system = null + if(on_resist) + qdel(on_resist) + on_resist = null + + if(on_life) + qdel(on_life) + on_life = null + . = ..() /mob/living/examine(var/mob/user, var/size = "", var/show_name = TRUE, var/show_icon = TRUE) //Show the mob's size and whether it's been butchered @@ -794,18 +805,6 @@ Thanks. /mob/living var/event/on_resist -/mob/living/New() - . = ..() - on_resist = new(owner = src) - on_life = new(owner = src) - -/mob/living/Destroy() - . = ..() - qdel(on_resist) - on_resist = null - qdel(on_life) - on_life = null - /mob/living/verb/resist() set name = "Resist" set category = "IC" diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 71015684753..113c7880a38 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -520,8 +520,6 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t emote("deathgasp", message = TRUE) health = 0 // so /mob/living/simple_animal/Life() doesn't magically revive them - living_mob_list -= src - dead_mob_list += src stat = DEAD if(icon_dying && !gibbed) do_flick(src, icon_dying, icon_dying_time) @@ -536,8 +534,6 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t for(var/butchering_type in L) src.butchering_drops += new butchering_type - verbs += /mob/living/proc/butcher - ..(gibbed)