From d722235c1529a5ce8571f9a8de3add3c99b8f918 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Fri, 13 Jan 2017 17:08:11 -0500 Subject: [PATCH] Fixes Operating Table and Operating Computer GCing --- code/game/machinery/OpTable.dm | 9 +++++++++ code/game/machinery/computer/Operating.dm | 12 +++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 873b86d9400..eb610c771a7 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -23,6 +23,15 @@ computer.table = src break +/obj/machinery/optable/Destroy() + if(computer) + computer.table = null + computer.victim = null + computer = null + if(victim) + victim = null + return ..() + /obj/machinery/optable/ex_act(severity) switch(severity) if(1.0) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index 31700f8c2d3..19d61e0daf9 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -29,6 +29,14 @@ table.computer = src break +/obj/machinery/computer/operating/Destroy() + if(table) + table.computer = null + table = null + if(victim) + victim = null + return ..() + /obj/machinery/computer/operating/attack_ai(mob/user) add_fingerprint(user) if(stat & (BROKEN|NOPOWER)) @@ -94,7 +102,9 @@ /obj/machinery/computer/operating/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) var/data[0] - var/mob/living/carbon/human/occupant = src.table.victim + var/mob/living/carbon/human/occupant + if(table) + occupant = table.victim data["hasOccupant"] = occupant ? 1 : 0 var/occupantData[0]