diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 415f604758a..741ecfa7fa2 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -251,6 +251,7 @@ var/global/list/default_medbay_channels = list( var/mob/living/automatedannouncer/A = new /mob/living/automatedannouncer(src) A.name = from A.role = role + A.message = message Broadcast_Message(connection, A, 0, "*garbled automated announcement*", src, message, from, "Automated Announcement", from, "synthesized voice", @@ -262,8 +263,23 @@ 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 + var/message = "" 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)], Name: \"[name]\", Message: \"[message]\"") + 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.