From 55bdf1c3cebf4c464943d7a6e93fe006ea02fef4 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Fri, 29 Apr 2016 18:08:57 -0700 Subject: [PATCH] Adds a noisy deletion timer to autosay mobs so we don't have silent failure --- code/game/objects/items/devices/radio/radio.dm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 415f604758a..0a98cfe5fc9 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -262,8 +262,22 @@ var/global/list/default_medbay_channels = list( // I'm not sure who thought that was a good idea. -- Crazylemon /mob/living/automatedannouncer var/role = "" + var/lifetime_timer universal_speak = 1 +/mob/living/automatedannouncer/New() + lifetime_timer = addtimer(src, "autocleanup", SecondsToTicks(10)) + ..() + +/mob/living/automatedannouncer/Destroy() + if(lifetime_timer) + deltimer(lifetime_timer) + ..() + +/mob/living/automatedannouncer/proc/autocleanup() + log_debug("An announcer somehow managed to outlive the radio! Deleting! Area: [get_area(src)], Loc: [src.locs[1]]" + qdel(src) + // Interprets the message mode when talking into a radio, possibly returning a connection datum /obj/item/device/radio/proc/handle_message_mode(mob/living/M as mob, message, message_mode) // If a channel isn't specified, send to common.