From da2bb9567e08781f8bec9046ec5b04ea6ba2910d Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Sun, 27 May 2018 14:01:43 -0400 Subject: [PATCH] Prevent autosay() from creating/deleting AIs Now it gets one dedicated AI it can move around instead. --- 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 95f8dcdbe7..97c1338deb 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 f5f85fe8f5..801b7e60cf 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 2b11059ff9..927216190a 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, @@ -789,5 +788,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