From 7528ac54fb655c3adc74c94d6a4433b285632285 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sat, 2 Jun 2018 11:46:38 -0500 Subject: [PATCH 1/2] Merge pull request #5305 from VOREStation/pol-autosay Prevent autosay() from creating/deleting AIs --- code/_helpers/global_lists.dm | 1 + code/game/objects/items/devices/radio/radio.dm | 4 +--- code/modules/mob/living/silicon/ai/ai.dm | 13 ++++++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index 34a58f18ca..2e776c82d0 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -9,6 +9,7 @@ var/global/list/player_list = list() //List of all mobs **with clients attach var/global/list/mob_list = list() //List of all mobs, including clientless var/global/list/human_mob_list = list() //List of all human mobs and sub-types, including clientless var/global/list/silicon_mob_list = list() //List of all silicon mobs, including clientless +var/global/list/ai_list = list() //List of all AIs, including clientless var/global/list/living_mob_list = list() //List of all alive mobs, including clientless. Excludes /mob/new_player var/global/list/dead_mob_list = list() //List of all dead mobs, including clientless. Excludes /mob/new_player var/global/list/listening_objects = list() //List of all objects which care about receiving messages (communicators, radios, etc) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index d408a033f7..716bbff1b8 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -247,14 +247,12 @@ var/global/list/default_medbay_channels = list( if (!connection) return - var/mob/living/silicon/ai/A = new /mob/living/silicon/ai(src, null, null, 1) + var/static/mob/living/silicon/ai/announcer/A = new /mob/living/silicon/ai/announcer(src, null, null, 1) A.SetName(from) Broadcast_Message(connection, A, 0, "*garbled automated announcement*", src, message, from, "Automated Announcement", from, "synthesized voice", 4, 0, list(0), connection.frequency, "states") - qdel(A) - return // 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) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 5fb2161d4f..8a34f5ee76 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -1,7 +1,6 @@ #define AI_CHECK_WIRELESS 1 #define AI_CHECK_RADIO 2 -var/list/ai_list = list() var/list/ai_verbs_default = list( // /mob/living/silicon/ai/proc/ai_recall_shuttle, /mob/living/silicon/ai/proc/ai_emergency_message, @@ -802,5 +801,17 @@ var/list/ai_verbs_default = list( // If that is ever fixed please update this proc. return TRUE +//Special subtype kept around for global announcements +/mob/living/silicon/ai/announcer/initialize() + . = ..() + mob_list -= src + living_mob_list -= src + dead_mob_list -= src + ai_list -= src + silicon_mob_list -= src + +/mob/living/silicon/ai/announcer/Life() + return + #undef AI_CHECK_WIRELESS #undef AI_CHECK_RADIO