From e275031fd1f846a16645911b5448702173009d07 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Wed, 13 May 2020 11:45:59 -0400 Subject: [PATCH] Optimize suit cooler processing --- code/game/objects/items/devices/suit_cooling.dm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index 8c8a208db8..0c097295bb 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -28,14 +28,17 @@ /obj/item/device/suit_cooling_unit/ui_action_click() toggle(usr) -/obj/item/device/suit_cooling_unit/New() - START_PROCESSING(SSobj, src) - cell = new/obj/item/weapon/cell/high() //comes not with the crappy default power cell - because this is dedicated EVA equipment - cell.loc = src +/obj/item/device/suit_cooling_unit/Initialize() + . = ..() + cell = new/obj/item/weapon/cell/high(src) //comes not with the crappy default power cell - because this is dedicated EVA equipment + +/obj/item/device/suit_cooling_unit/Destroy() + qdel_null(cell) + return ..() /obj/item/device/suit_cooling_unit/process() if (!on || !cell) - return + return PROCESS_KILL if (!ismob(loc)) return @@ -106,11 +109,13 @@ return on = 1 + START_PROCESSING(SSobj, src) updateicon() /obj/item/device/suit_cooling_unit/proc/turn_off(var/failed) if(failed) visible_message("\The [src] clicks and whines as it powers down.") on = 0 + STOP_PROCESSING(SSobj, src) updateicon() /obj/item/device/suit_cooling_unit/attack_self(var/mob/user)