diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 256aee3b322..8d30dd0343a 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -136,13 +136,13 @@ /proc/recursive_hear_check(var/atom/O) var/list/processing_list = list(O) var/list/processed_list = list() - var/list/found_mobs = list() + var/list/found_atoms = list() while(processing_list.len) var/atom/A = processing_list[1] if(A.flags & HEAR) - found_mobs |= A + found_atoms |= A for(var/atom/B in A) if(!processed_list[B]) @@ -151,7 +151,8 @@ processing_list.Cut(1, 2) processed_list[A] = A - return found_mobs + return found_atoms + // Better recursive loop, technically sort of not actually recursive cause that shit is retarded, enjoy. //No need for a recursive limit either /proc/recursive_mob_check(var/atom/O,var/client_check=1,var/sight_check=1,var/include_radio=1) @@ -195,7 +196,7 @@ /proc/get_hearers_in_view(var/R, var/atom/source) - // Returns a list of hearers in range of R from source. Used in saycode. + // Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode. var/turf/T = get_turf(source) var/list/hear = list() @@ -215,25 +216,9 @@ . = list() // Returns a list of mobs who can hear any of the radios given in @radios - var/list/speaker_coverage = list() - for(var/i = 1; i <= radios.len; i++) - var/obj/item/device/radio/R = radios[i] + for(var/obj/item/device/radio/R in radios) if(R) - var/turf/speaker = get_turf(R) - if(speaker) - for(var/turf/T in get_hear(R.canhear_range,speaker)) - speaker_coverage[T] = T - - - // Try to find all the players who can hear the message - for(var/i = 1; i <= player_list.len; i++) - var/mob/M = player_list[i] - if(M) - var/turf/ear = get_turf(M) - if(ear) - if(speaker_coverage[ear]) - . |= M - return . + . |= get_hearers_in_view(R.canhear_range, R) #define SIGN(X) ((X<0)?-1:1) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index c15e4cfa516..6724122a501 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -363,3 +363,16 @@ var/list/binary = list("0","1") temp = findtextEx(haystack, ascii2text(text2ascii(needles,i)), start, end) //Note: ascii2text(text2ascii) is faster than copytext() if(temp) end = temp return end + +//this proc strips html properly, but it's not lazy like the other procs. +//this means that it doesn't just remove < and > and call it a day. seriously, who the fuck thought that would be useful. +/proc/strip_html_properly(var/input) + var/opentag = 1 //These store the position of < and > respectively. + var/closetag = 1 + while(1) + opentag = findtext(input, "<") + closetag = findtext(input, ">") + if(!closetag || !opentag) + break + input = copytext(input, 1, opentag) + copytext(input, (closetag + 1)) + return input diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 3945db0dd83..094cbd93a40 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -94,8 +94,7 @@ /obj/item/device/taperecorder/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq) if(mytape && recording) mytape.timestamp += mytape.used_capacity - mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] [message]" - + mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] [strip_html_properly(message)]" /obj/item/device/taperecorder/verb/record() set name = "Start Recording" diff --git a/code/game/say.dm b/code/game/say.dm index e7ed32f28f3..c4dfd8454a0 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -16,19 +16,6 @@ var/list/freqtospan = list( "1441" = "dsquadradio" ) -var/list/freqtoname = list( - "1351" = "Science", - "1353" = "Command", - "1355" = "Medical", - "1357" = "Engineering", - "1359" = "Security", - "1441" = "Deathsquad", - "1213" = "Syndicate", - "1347" = "Supply", - "1349" = "Service", - "1447" = "AI Private" -) - /atom/movable/proc/say(message) if(!can_speak()) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 3a1017aacd0..ce3e42e441f 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -452,18 +452,17 @@ var/list/admin_verbs_hideable = list( /client/proc/object_say(var/obj/O in world) set category = "Special Verbs" set name = "Object Say" - set desc = "Makes an object say something." - if(istype(O)) - var/message = input("What do you want the message to be?", "Object Say") as text | null - if(!message) - return - var/templanguages = O.languages - O.languages |= ALL - O.say(message) - O.languages = templanguages - log_admin("[key_name(usr)] made [O] at [O.x], [O.y], [O.z] say [message]") - message_admins("[key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z]. say [message]", 1) - feedback_add_details("admin_verb","MS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + set desc = "Makes an object say something." + var/message = input(usr, "What do you want the message to be?", "Make Sound") as text | null + if(!message) + return + var/templanguages = O.languages + O.languages |= ALL + O.say(message) + O.languages = templanguages + log_admin("[key_name(usr)] made [O] at [O.x], [O.y], [O.z] say \"[message]\"") + message_admins("[key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z]. say \"[message]\"", 1) + feedback_add_details("admin_verb","OS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/togglebuildmodeself() set name = "Toggle Build Mode Self" diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 9eb619a907f..2981a2374da 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -1,6 +1,3 @@ -/mob/living/carbon/human/say(var/message) - ..(message) - /mob/living/carbon/human/say_quote(text) if(!text) return "says, \"...\""; //not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code