From 4e36843f8c8f2d2517c4bb4a44e96f93dd07aefa Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 2 Oct 2020 14:57:29 +0200 Subject: [PATCH] [MIRROR] More deletion cleanup (#1112) * More deletion cleanup (#53681) - Observer mobs not delling correctly - AI delling basically nothing - pods not delling glow effect - minor slime cleanup * More deletion cleanup Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com> --- code/datums/spawners_menu.dm | 5 +++++ code/modules/cargo/supplypod.dm | 4 +++- code/modules/mob/living/silicon/ai/ai.dm | 17 +++++++++++++---- .../mob/living/simple_animal/slime/slime.dm | 3 +-- code/modules/mob/living/ventcrawling.dm | 2 +- .../xenobiology/crossbreeding/charged.dm | 2 +- .../xenobiology/crossbreeding/chilling.dm | 2 +- .../mecha/equipment/weapons/mecha_ammo.dm | 4 ++-- 8 files changed, 27 insertions(+), 12 deletions(-) diff --git a/code/datums/spawners_menu.dm b/code/datums/spawners_menu.dm index 9e7e4b334dd..f197c96f3ee 100644 --- a/code/datums/spawners_menu.dm +++ b/code/datums/spawners_menu.dm @@ -6,6 +6,11 @@ qdel(src) owner = new_owner +/datum/spawners_menu/Destroy() + owner = null + return ..() + + /datum/spawners_menu/ui_state(mob/user) return GLOB.observer_state diff --git a/code/modules/cargo/supplypod.dm b/code/modules/cargo/supplypod.dm index 921ecb59adc..19532b35571 100644 --- a/code/modules/cargo/supplypod.dm +++ b/code/modules/cargo/supplypod.dm @@ -166,7 +166,7 @@ . += decal return else if (GLOB.podstyles[style][POD_SHAPE] != POD_SHAPE_NORML) //If we're not a normal pod shape (aka, if we don't have fins), just add the door without masking - . += door + . += door else var/icon/masked_door = new(icon, door) //The door we want to apply var/icon/fin_masker = new(icon, "mask_[fin_mask]") //The fin shape we want to 'cut out' of the door @@ -456,9 +456,11 @@ return glow_effect.layer = LOW_ITEM_LAYER glow_effect.fadeAway(delays[POD_OPENING]) + glow_effect = null /obj/structure/closet/supplypod/Destroy() deleteRubble() + endGlow() open_pod(src, broken = TRUE) //Lets dump our contents by opening up return ..() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 5bb745c4704..7ce45c53153 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -39,10 +39,11 @@ var/can_be_carded = TRUE var/alarms = list("Motion"=list(), "Fire"=list(), "Atmosphere"=list(), "Power"=list(), "Camera"=list(), "Burglar"=list()) var/viewalerts = 0 - var/icon/holo_icon//Default is assigned when AI is created. + var/icon/holo_icon //Default is assigned when AI is created. var/obj/vehicle/sealed/mecha/controlled_mech //For controlled_mech a mech, to determine whether to relaymove or use the AI eye. var/radio_enabled = TRUE //Determins if a carded AI can speak with its built in radio or not. radiomod = ";" //AIs will, by default, state their laws on the internal radio. + ///Used as a fake multitoool in tcomms machinery var/obj/item/multitool/aiMulti var/mob/living/simple_animal/bot/Bot var/tracking = FALSE //this is 1 if the AI is currently tracking somebody, but the track has not yet been completed. @@ -193,10 +194,18 @@ GLOB.ai_list -= src GLOB.shuttle_caller_list -= src SSshuttle.autoEvac() - qdel(eyeobj) // No AI, no Eye + QDEL_NULL(eyeobj) // No AI, no Eye + QDEL_NULL(spark_system) + QDEL_NULL(malf_picker) + QDEL_NULL(doomsday_device) + QDEL_NULL(robot_control) + QDEL_NULL(aiMulti) malfhack = null - - . = ..() + current = null + Bot = null + controlled_mech = null + linked_core = null + return ..() /// Removes all malfunction-related abilities from the AI /mob/living/silicon/ai/proc/remove_malf_abilities() diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index 59c33681a81..fa72346f07a 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -109,8 +109,7 @@ AC.Remove(src) Target = null Leader = null - Friends.Cut() - speech_buffer.Cut() + Friends = null return ..() /mob/living/simple_animal/slime/proc/set_colour(new_colour) diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm index 2456ce6fe54..4585247d389 100644 --- a/code/modules/mob/living/ventcrawling.dm +++ b/code/modules/mob/living/ventcrawling.dm @@ -69,7 +69,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list( if(buckled) to_chat(src, "I can't vent crawl while feeding...") return - ..() + return ..() /mob/living/proc/add_ventcrawl(obj/machinery/atmospherics/starting_machine) diff --git a/code/modules/research/xenobiology/crossbreeding/charged.dm b/code/modules/research/xenobiology/crossbreeding/charged.dm index 858fa6a8d3e..43581cedc2b 100644 --- a/code/modules/research/xenobiology/crossbreeding/charged.dm +++ b/code/modules/research/xenobiology/crossbreeding/charged.dm @@ -274,4 +274,4 @@ Charged extracts: for(var/i in 1 to 3) var/mob/living/simple_animal/slime/S = new(get_turf(user)) S.random_colour() - ..() + return ..() diff --git a/code/modules/research/xenobiology/crossbreeding/chilling.dm b/code/modules/research/xenobiology/crossbreeding/chilling.dm index 3acdf7ff779..8c2aacfe2b8 100644 --- a/code/modules/research/xenobiology/crossbreeding/chilling.dm +++ b/code/modules/research/xenobiology/crossbreeding/chilling.dm @@ -238,7 +238,7 @@ Chilling extracts: user.visible_message("[src] lets out a peaceful ring as it shatters, and nearby slimes seem calm.") else user.visible_message("[src] lets out a peaceful ring as it shatters, but nothing happens...") - ..() + return ..() /obj/item/slimecross/chilling/green colour = "green" diff --git a/code/modules/vehicles/mecha/equipment/weapons/mecha_ammo.dm b/code/modules/vehicles/mecha/equipment/weapons/mecha_ammo.dm index 8ab7915b16b..af0b51e9037 100644 --- a/code/modules/vehicles/mecha/equipment/weapons/mecha_ammo.dm +++ b/code/modules/vehicles/mecha/equipment/weapons/mecha_ammo.dm @@ -25,9 +25,9 @@ return to_chat(user, "You fold [src] flat.") - var/I = new /obj/item/stack/sheet/metal(user.loc) + var/trash = new /obj/item/stack/sheet/metal(user.loc) qdel(src) - user.put_in_hands(I) + user.put_in_hands(trash) /obj/item/mecha_ammo/examine(mob/user) . = ..()