Makes some loops use GLOB.ai_list instead of other various lists (#27916)

* Thngy

* Update code/modules/mob/living/silicon/ai/ai_mob.dm

Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>

---------

Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
DGamerL
2025-01-12 11:09:30 +01:00
committed by GitHub
parent 0228b81ff5
commit a8a17134eb
8 changed files with 10 additions and 10 deletions
@@ -6,7 +6,7 @@
"Ionospheri:%? MCayj^j<.3-BZZZZZZT", \
"#4nd%;f4y6,>?%-BZZZZZZZT")
for(var/mob/living/silicon/ai/A in GLOB.player_list) //AIs are always aware of communication blackouts.
for(var/mob/living/silicon/ai/A in GLOB.ai_list) //AIs are always aware of communication blackouts.
to_chat(A, "<br>")
to_chat(A, "<span class='warning'><b>[alert]</b></span>")
to_chat(A, "<br>")
+1 -1
View File
@@ -99,7 +99,7 @@
last_spam_time = world.time
if(prob(50)) //Give the AI an increased chance to intercept the message
for(var/mob/living/silicon/ai/ai in GLOB.mob_list)
for(var/mob/living/silicon/ai/ai in GLOB.ai_list)
// Allows other AIs to intercept the message but the AI won't intercept their own message.
if(ai.aiPDA != P && ai.aiPDA != src)
ai.show_message("<i>Intercepted message from <b>[sender]</b></i> (Unknown / spam?) <i>to <b>[P:owner]</b>: [message]</i>")
+2 -2
View File
@@ -154,8 +154,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
var/pickedName = null
while(!pickedName)
pickedName = pick(GLOB.ai_names)
for(var/mob/living/silicon/ai/A in GLOB.mob_list)
if(A.real_name == pickedName && length(possibleNames) > 1) //fixing the theoretically possible infinite loop
for(var/mob/living/silicon/ai/A in GLOB.ai_list)
if(A.real_name == pickedName && length(possibleNames) > 1) // fixing the theoretically possible infinite loop
possibleNames -= pickedName
pickedName = null
+2 -2
View File
@@ -400,7 +400,7 @@
/mob/new_player/proc/AnnounceArrival(mob/living/carbon/human/character, rank, join_message)
if(SSticker.current_state == GAME_STATE_PLAYING)
var/ailist[] = list()
for(var/mob/living/silicon/ai/A in GLOB.alive_mob_list)
for(var/mob/living/silicon/ai/A in GLOB.ai_list)
if(A.announce_arrivals)
ailist += A
if(length(ailist))
@@ -433,7 +433,7 @@
/mob/new_player/proc/AnnounceCyborg(mob/living/character, rank, join_message)
if(SSticker.current_state == GAME_STATE_PLAYING)
var/ailist[] = list()
for(var/mob/living/silicon/ai/A in GLOB.alive_mob_list)
for(var/mob/living/silicon/ai/A in GLOB.ai_list)
ailist += A
if(length(ailist))
var/mob/living/silicon/ai/announcer = pick(ailist)