From a5f358b272362366d57096cd4fa3fdc2752ca5a7 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Wed, 13 May 2020 12:12:06 -0400 Subject: [PATCH] Optimize geiger counter processing --- code/game/objects/items/devices/geiger.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/devices/geiger.dm b/code/game/objects/items/devices/geiger.dm index b9b177e683..62c1f7d1ed 100644 --- a/code/game/objects/items/devices/geiger.dm +++ b/code/game/objects/items/devices/geiger.dm @@ -13,7 +13,6 @@ var/datum/looping_sound/geiger/soundloop /obj/item/device/geiger/Initialize() - START_PROCESSING(SSobj, src) soundloop = new(list(src), FALSE) return ..() @@ -60,6 +59,10 @@ /obj/item/device/geiger/attack_self(var/mob/user) scanning = !scanning + if(scanning) + START_PROCESSING(SSobj, src) + else + STOP_PROCESSING(SSobj, src) update_icon() update_sound() to_chat(user, "[bicon(src)] You switch [scanning ? "on" : "off"] \the [src].")