From 196d0b90f95c06228421d9d482767be3877ad055 Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Sat, 7 Apr 2018 23:38:10 -0400 Subject: [PATCH 1/2] Makes Records GC (most of the time) --- code/datums/mixed.dm | 11 +++++++++-- code/game/machinery/computer/medical.dm | 7 ++++++- code/game/machinery/computer/security.dm | 4 ++++ code/game/machinery/computer/skills.dm | 3 +++ code/game/objects/items/weapons/cards_ids.dm | 1 - code/modules/mob/living/silicon/pai/pai.dm | 8 ++++++++ 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/code/datums/mixed.dm b/code/datums/mixed.dm index 391b7090ad4..40e9ea47fac 100644 --- a/code/datums/mixed.dm +++ b/code/datums/mixed.dm @@ -22,8 +22,15 @@ var/list/fields = list( ) /datum/data/record/Destroy() - ..() - return QDEL_HINT_HARDDEL_NOW + if(src in data_core.medical) + data_core.medical -= src + if(src in data_core.security) + data_core.security -= src + if(src in data_core.general) + data_core.general -= src + if(src in data_core.locked) + data_core.locked -= src + . = ..() /datum/data/text name = "text" diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 1fa129262fb..5e16fe42828 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -5,7 +5,7 @@ #define MED_DATA_V_DATA 5 // Virus database #define MED_DATA_MEDBOT 6 // Medbot monitor -/obj/machinery/computer/med_data//TODO:SANITY +/obj/machinery/computer/med_data //TODO:SANITY name = "medical records console" desc = "This can be used to check medical records." icon_keyboard = "med_key" @@ -23,6 +23,11 @@ light_color = LIGHT_COLOR_DARKBLUE +/obj/machinery/computer/med_data/Destroy() + active1 = null + active2 = null + return ..() + /obj/machinery/computer/med_data/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/weapon/card/id) && !scan) usr.drop_item() diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 9425d6df984..0600f8c1a08 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -24,6 +24,10 @@ light_color = LIGHT_COLOR_RED +/obj/machinery/computer/secure_data/Destroy() + active1 = null + active2 = null + return ..() /obj/machinery/computer/secure_data/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/weapon/card/id) && !scan) diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 156a685655e..5c0a0cffd55 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -23,6 +23,9 @@ var/sortBy = "name" var/order = 1 // -1 = Descending - 1 = Ascending +/obj/machinery/computer/skills/Destroy() + active1 = null + return ..() /obj/machinery/computer/skills/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/weapon/card/id) && !scan) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 5ff29566008..f28d316f394 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -99,7 +99,6 @@ var/rank = null //actual job var/dorm = 0 // determines if this ID has claimed a dorm already - var/datum/data/record/active1 = null var/sex var/age var/photo diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index c6ae2e94610..a99faca4a09 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -118,6 +118,14 @@ C.toff = 1 ..() +/mob/living/silicon/pai/Destroy() + medicalActive1 = null + medicalActive2 = null + securityActive1 = null + securityActive2 = null + return ..() + + /mob/living/silicon/pai/movement_delay() . = ..() . += slowdown From f9421e3b228204d81c0f4c2fd2a7aa38f6716f74 Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Sat, 7 Apr 2018 23:41:29 -0400 Subject: [PATCH 2/2] explicit return --- code/datums/mixed.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/mixed.dm b/code/datums/mixed.dm index 40e9ea47fac..a40a9f9a34d 100644 --- a/code/datums/mixed.dm +++ b/code/datums/mixed.dm @@ -30,7 +30,7 @@ data_core.general -= src if(src in data_core.locked) data_core.locked -= src - . = ..() + return ..() /datum/data/text name = "text"