diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm
index d76a631cc0b..54137f7d081 100644
--- a/code/__HELPERS/game.dm
+++ b/code/__HELPERS/game.dm
@@ -159,30 +159,22 @@
// It will keep doing this until it checks every content possible. This will fix any problems with mobs, that are inside objects,
// being unable to hear people due to being in a box within a bag.
-/proc/recursive_mob_check(atom/O, list/L = list(), recursion_limit = 3, client_check = 1, sight_check = 1, include_radio = 1)
-
- //GLOB.debug_mob += O.contents.len
+/proc/recursive_mob_check(atom/O, list/L = list(), recursion_limit = 3, client_check = TRUE, sight_check = TRUE)
if(!recursion_limit)
return L
for(var/atom/A in O.contents)
-
if(ismob(A))
var/mob/M = A
if(client_check && !M.client)
- L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
+ L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check)
continue
if(sight_check && !isInSight(A, O))
continue
L |= M
//log_world("[recursion_limit] = [M] - [get_turf(M)] - ([M.x], [M.y], [M.z])")
- else if(include_radio && isradio(A))
- if(sight_check && !isInSight(A, O))
- continue
- L |= A
-
if(isobj(A) || ismob(A))
- L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check, include_radio)
+ L |= recursive_mob_check(A, L, recursion_limit - 1, client_check, sight_check)
return L
// The old system would loop through lists for a total of 5000 per function call, in an empty server.
@@ -197,23 +189,17 @@
if(!T)
return hear
- var/list/range = hear(R, T)
-
- for(var/atom/A in range)
+ for(var/atom/A in hear(R, T))
if(ismob(A))
var/mob/M = A
if(M.client || include_clientless)
hear += M
- //log_world("Start = [M] - [get_turf(M)] - ([M.x], [M.y], [M.z])")
- else if(isradio(A))
- hear += A
if(isobj(A) || ismob(A))
- hear |= recursive_mob_check(A, hear, 3, 1, 0, 1)
+ hear |= recursive_mob_check(A, hear, 3, TRUE, FALSE)
return hear
-
/proc/get_mobs_in_radio_ranges(list/obj/item/radio/radios)
. = list()
// Returns a list of mobs who can hear any of the radios given in @radios
@@ -235,7 +221,6 @@
for(var/turf/T in hear(R.canhear_range,speaker))
speaker_coverage[T] = T
-
// Try to find all the players who can hear the message
for(var/A in GLOB.player_list + GLOB.hear_radio_list)
var/mob/M = A
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 50a5df5f38d..33db8019b97 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -720,16 +720,19 @@ Returns 1 if the chain up to the area contains the given typepath
//Takes: Area type as text string or as typepath OR an instance of the area.
//Returns: A list of all turfs in areas of that type of that type in the world.
/proc/get_area_turfs(areatype)
- if(!areatype) return null
- if(istext(areatype)) areatype = text2path(areatype)
+ if(!areatype)
+ return
+ if(istext(areatype))
+ areatype = text2path(areatype)
if(isarea(areatype))
var/area/areatemp = areatype
areatype = areatemp.type
var/list/turfs = list()
- for(var/area/N in world)
+ for(var/area/N as anything in GLOB.all_areas)
if(istype(N, areatype))
- for(var/turf/T in N) turfs += T
+ for(var/turf/T in N)
+ turfs += T
return turfs
//Takes: Area type as text string or as typepath OR an instance of the area.
@@ -754,7 +757,7 @@ Returns 1 if the chain up to the area contains the given typepath
var/y_pos
var/z_pos
-/area/proc/move_contents_to(area/A, turf_to_leave, direction)
+/area/proc/move_contents_to(area/A, turf_to_leave, direction) // someone rewrite this function i beg of you
//Takes: Area. Optional: turf type to leave behind.
//Returns: Nothing.
//Notes: Attempts to move the contents of one area to another area.
@@ -763,7 +766,7 @@ Returns 1 if the chain up to the area contains the given typepath
if(!A || !src) return 0
- var/list/turfs_src = get_area_turfs(src.type)
+ var/list/turfs_src = get_area_turfs(type)
var/list/turfs_trg = get_area_turfs(A.type)
var/src_min_x = 0
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 85edb417fba..0e789eacb89 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -81,7 +81,6 @@
add_fingerprint(user)
-
//the equivalent of the standard version of attack() but for object targets.
/obj/item/proc/attack_obj(obj/O, mob/living/user, params)
if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_OBJ, O, user) & COMPONENT_NO_ATTACK_OBJ)
diff --git a/code/controllers/subsystem/non_firing/SSmapping.dm b/code/controllers/subsystem/non_firing/SSmapping.dm
index 6b33a817f4a..7a90cc3dd87 100644
--- a/code/controllers/subsystem/non_firing/SSmapping.dm
+++ b/code/controllers/subsystem/non_firing/SSmapping.dm
@@ -83,33 +83,47 @@ SUBSYSTEM_DEF(mapping)
log_startup_progress("Skipping lavaland ruins...")
// Now we make a list of areas for teleport locs
+ // Located below is some of the worst code I've ever seen
+ // Checking all areas to see if they have a turf in them? Nice one ssmapping!
+
+ var/list/all_areas = list()
+ for(var/area/areas in world)
+ all_areas += areas
+
teleportlocs = list()
- for(var/area/AR in world)
+ for(var/area/AR as anything in all_areas)
if(AR.no_teleportlocs)
continue
if(teleportlocs[AR.name])
continue
- var/turf/picked = safepick(get_area_turfs(AR.type))
+ var/list/pickable_turfs = list()
+ for(var/turf/turfs in AR)
+ pickable_turfs += turfs
+ var/turf/picked = safepick(pickable_turfs)
if(picked && is_station_level(picked.z))
teleportlocs[AR.name] = AR
teleportlocs = sortAssoc(teleportlocs)
-
ghostteleportlocs = list()
- for(var/area/AR in world)
+ for(var/area/AR as anything in all_areas)
if(ghostteleportlocs[AR.name])
continue
- var/list/turfs = get_area_turfs(AR.type)
- if(turfs.len)
+ var/list/pickable_turfs = list()
+ for(var/turf/turfs in AR)
+ pickable_turfs += turfs
+ if(length(pickable_turfs))
ghostteleportlocs[AR.name] = AR
ghostteleportlocs = sortAssoc(ghostteleportlocs)
// Now we make a list of areas that exist on the station. Good for if you don't want to select areas that exist for one station but not others. Directly references
existing_station_areas = list()
- for(var/area/AR in world)
- var/turf/picked = safepick(get_area_turfs(AR.type))
+ for(var/area/AR as anything in all_areas)
+ var/list/pickable_turfs = list()
+ for(var/turf/turfs in AR)
+ pickable_turfs += turfs
+ var/turf/picked = safepick(pickable_turfs)
if(picked && is_station_level(picked.z))
existing_station_areas += AR
diff --git a/code/datums/emote.dm b/code/datums/emote.dm
index 42304b2f879..23e3ca9850a 100644
--- a/code/datums/emote.dm
+++ b/code/datums/emote.dm
@@ -280,7 +280,7 @@
runechat_text = "[copytext(text, 1, 101)]..."
var/list/can_see = get_mobs_in_view(1, user) //Allows silicon & mmi mobs carried around to see the emotes of the person carrying them around.
can_see |= viewers(user, null)
- for(var/mob/O in can_see)
+ for(var/mob/O as anything in can_see)
if(O.status_flags & PASSEMOTES)
for(var/obj/item/holder/H in O.contents)
H.show_message(text, EMOTE_VISIBLE)
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index cf70c3d27bb..c76d3d6d7f8 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -1096,7 +1096,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
if(!message)
return
var/list/speech_bubble_hearers = list()
- for(var/mob/M in get_mobs_in_view(7, src))
+ for(var/mob/M as anything in get_mobs_in_view(7, src))
M.show_message("[src] [atom_say_verb], \"[message]\"", 2, null, 1)
if(M.client)
speech_bubble_hearers += M.client
diff --git a/code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm b/code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm
index 993273c39b7..6dbc087e0e5 100644
--- a/code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm
+++ b/code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm
@@ -571,7 +571,7 @@
else if(istype(loc, /obj/machinery/hologram/holopad))
var/obj/machinery/hologram/holopad/H = loc
name = "[H]"
- for(var/mob/M in get_mobs_in_view(7, H))
+ for(var/mob/M as anything in get_mobs_in_view(7, H))
M.hear_say(message_pieces, verb, FALSE, src)
name = real_name
return TRUE
@@ -587,7 +587,7 @@
/mob/living/simple_animal/demon/pulse_demon/visible_message(message, self_message, blind_message)
// overriden because pulse demon is quite often in non-turf locs, and /mob/visible_message acts differently there
- for(var/mob/M in get_mobs_in_view(7, src))
+ for(var/mob/M as anything in get_mobs_in_view(7, src))
if(M.see_invisible < invisibility)
continue //can't view the invisible
var/msg = message
diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm
index 72e5e67d539..3aa54e27af6 100644
--- a/code/game/objects/items/devices/megaphone.dm
+++ b/code/game/objects/items/devices/megaphone.dm
@@ -83,7 +83,7 @@
for(var/obj/O in view(14, get_turf(src)))
O.hear_talk(user, message_to_multilingual("[message]"))
- for(var/mob/M in get_mobs_in_view(7, src))
+ for(var/mob/M as anything in get_mobs_in_view(7, src))
if((M.client?.prefs.toggles2 & PREFTOGGLE_2_RUNECHAT) && M.can_hear())
M.create_chat_message(user, message, FALSE, "big")
diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm
index 6e66f17366b..1ced9680dc0 100644
--- a/code/game/objects/items/devices/radio/beacon.dm
+++ b/code/game/objects/items/devices/radio/beacon.dm
@@ -26,10 +26,6 @@
/obj/item/radio/beacon/hear_talk()
return
-
-/obj/item/radio/beacon/send_hear()
- return null
-
/// Probably a better way of doing this, I'm lazy.
/obj/item/radio/beacon/bacon
diff --git a/code/game/objects/items/devices/radio/radio_objects.dm b/code/game/objects/items/devices/radio/radio_objects.dm
index 64a5c5c3bfa..514c33c672c 100644
--- a/code/game/objects/items/devices/radio/radio_objects.dm
+++ b/code/game/objects/items/devices/radio/radio_objects.dm
@@ -542,11 +542,6 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
return -1
return canhear_range
-/obj/item/radio/proc/send_hear(freq, level)
- var/range = receive_range(freq, level)
- if(range > -1)
- return get_mobs_in_view(canhear_range, src)
-
/obj/item/radio/proc/is_listening()
var/is_listening = TRUE
if(!on)
diff --git a/code/modules/antagonists/changeling/powers/shriek.dm b/code/modules/antagonists/changeling/powers/shriek.dm
index 90c98ab8e6c..e2e1862f598 100644
--- a/code/modules/antagonists/changeling/powers/shriek.dm
+++ b/code/modules/antagonists/changeling/powers/shriek.dm
@@ -13,7 +13,7 @@
/datum/action/changeling/resonant_shriek/sting_action(mob/user)
if(istype(user.loc, /obj/machinery/atmospherics))
return FALSE
- for(var/mob/living/M in get_mobs_in_view(4, user))
+ for(var/mob/living/M as anything in get_mobs_in_view(4, user))
if(iscarbon(M))
if(ishuman(M))
var/mob/living/carbon/human/H = M
diff --git a/code/modules/mob/living/silicon/ai/ai_mob.dm b/code/modules/mob/living/silicon/ai/ai_mob.dm
index 1fcd822f383..dabfb32bafb 100644
--- a/code/modules/mob/living/silicon/ai/ai_mob.dm
+++ b/code/modules/mob/living/silicon/ai/ai_mob.dm
@@ -135,6 +135,9 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
/mob/living/silicon/proc/subsystem_law_manager,
/mob/living/silicon/proc/subsystem_power_monitor)
+ /// The cached AI annoucement help menu.
+ var/ai_announcement_string_menu
+
/mob/living/silicon/ai/proc/add_ai_verbs()
add_verb(src, GLOB.ai_verbs_default)
add_verb(src, silicon_subsystems)
@@ -1545,6 +1548,13 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
var/mob/dead/observer/ghost = .
ghost.forceMove(old_turf)
+/mob/living/silicon/ai/can_vv_get(var_name)
+ if(!..())
+ return FALSE
+ if(var_name == "ai_announcement_string_menu") // This single var has over 80 thousand characters in it. Not something you really want when VVing the AI
+ return FALSE
+ return TRUE
+
/mob/living/silicon/ai/proc/blurb_it()
addtimer(CALLBACK(src, TYPE_PROC_REF(/mob/living/silicon/ai, show_ai_blurb)), 1 SECONDS)
diff --git a/code/modules/mob/living/silicon/ai/ai_say.dm b/code/modules/mob/living/silicon/ai/ai_say.dm
index d8b720ad7f2..99f16c1228f 100644
--- a/code/modules/mob/living/silicon/ai/ai_say.dm
+++ b/code/modules/mob/living/silicon/ai/ai_say.dm
@@ -74,24 +74,25 @@ GLOBAL_VAR_INIT(announcing_vox, 0) // Stores the time of the last announcement
set desc = "Display a list of vocal words to announce to the crew."
set category = "AI Commands"
- var/list/dat = list()
+ if(!ai_announcement_string_menu)
+ var/list/dat = list()
- dat += "Here is a list of words you can type into the 'Announcement' button to create sentences to vocally announce to everyone on the same level at you.
\
-