Fix mob say_quote() not being used when lang is null.

Fixes #6094
This commit is contained in:
Rob Nelson
2015-10-12 18:02:06 -07:00
parent 7f6b8df611
commit 6560317d17
20 changed files with 49 additions and 41 deletions

View File

@@ -70,6 +70,11 @@
rendered="<span class='[list2text(message_classes, " ")]'>[lquote][rendered][rquote]</span>" rendered="<span class='[list2text(message_classes, " ")]'>[lquote][rendered][rquote]</span>"
if(language) if(language)
rendered=language.render_speech(src, rendered) rendered=language.render_speech(src, rendered)
else
if(speaker)
rendered=speaker.say_quote(rendered)
else
warning("Speaker not set! (message=\"[message]\")")
#ifdef SAY_DEBUG #ifdef SAY_DEBUG
speaker << "[type]/render_message(): message = \"[html_encode(rendered)]\"" speaker << "[type]/render_message(): message = \"[html_encode(rendered)]\""
#endif #endif

View File

@@ -147,4 +147,4 @@ var/list/doppler_arrays = list()
nanomanager.update_uis(src) nanomanager.update_uis(src)
/obj/machinery/doppler_array/say_quote(text) /obj/machinery/doppler_array/say_quote(text)
return "states coldly, \"[text]\"" return "coldly states, [text]"

View File

@@ -1310,7 +1310,7 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob)
return return
/obj/machinery/newscaster/say_quote(text) /obj/machinery/newscaster/say_quote(text)
return "beeps, \"[text]\"" return "beeps, [text]"
#undef NEWSCASTER_MENU #undef NEWSCASTER_MENU
#undef NEWSCASTER_CHANNEL_LIST #undef NEWSCASTER_CHANNEL_LIST

View File

@@ -388,9 +388,9 @@ var/list/obj/machinery/requests_console/allConsoles = list()
/obj/machinery/say_quote(var/text) /obj/machinery/say_quote(var/text)
var/ending = copytext(text, length(text) - 2) var/ending = copytext(text, length(text) - 2)
if(ending == "!!!") if(ending == "!!!")
return "blares, \"[text]\"" return "blares, [text]"
return "beeps, \"[text]\"" return "beeps, [text]"
//deconstruction and hacking //deconstruction and hacking
/obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob) /obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob)

View File

@@ -843,7 +843,7 @@
say(message) say(message)
/obj/machinery/vending/say_quote(text) /obj/machinery/vending/say_quote(text)
return "beeps, \"[text]\"" return "beeps, [text]"
/obj/machinery/vending/power_change() /obj/machinery/vending/power_change()
if(stat & BROKEN) if(stat & BROKEN)

View File

@@ -135,9 +135,9 @@ var/list/freqtoname = list(
return "says, \"...\"" //not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code return "says, \"...\"" //not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (ending == "?") if (ending == "?")
return "asks, \"[text]\"" return "asks, [text]"
if (ending == "!") if (ending == "!")
return "exclaims, \"[text]\"" return "exclaims, [text]"
return "says, \"[text]\"" return "says, \"[text]\""
var/global/image/ghostimg = image("icon"='icons/mob/mob.dmi',"icon_state"="ghost") var/global/image/ghostimg = image("icon"='icons/mob/mob.dmi',"icon_state"="ghost")

View File

@@ -36,7 +36,7 @@
// why is this here. // why is this here.
/obj/machinery/vending/say_quote(text) /obj/machinery/vending/say_quote(text)
return "beeps, \"[text]\"" return "beeps, [text]"
/obj/item/device/assembly/voice/toggle_secure() /obj/item/device/assembly/voice/toggle_secure()
. = ..() . = ..()

View File

@@ -21,11 +21,11 @@
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (ending == "?") if (ending == "?")
return "[pick("moans", "gripes", "grumps", "murmurs", "mumbles", "bleats")], \"[text]\""; return "[pick("moans", "gripes", "grumps", "murmurs", "mumbles", "bleats")], [text]";
else if (ending == "!") else if (ending == "!")
return "[pick("screams", "screeches", "howls")], \"[text]\""; return "[pick("screams", "screeches", "howls")], [text]";
return "[pick("whines", "cries", "spooks", "complains", "drones", "mutters")], \"[text]\""; return "[pick("whines", "cries", "spooks", "complains", "drones", "mutters")], [text]";
/mob/dead/observer/Hear(var/datum/speech/speech, var/rendered_speech="") /mob/dead/observer/Hear(var/datum/speech/speech, var/rendered_speech="")
if (isnull(client) || !speech.speaker) if (isnull(client) || !speech.speaker)

View File

@@ -6,20 +6,20 @@
return "says, \"...\""; //not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code return "says, \"...\""; //not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (src.stuttering) if (src.stuttering)
return "stammers, \"[text]\""; return "stammers, [text]";
if(isliving(src)) if(isliving(src))
var/mob/living/L = src var/mob/living/L = src
if (L.getBrainLoss() >= 60) if (L.getBrainLoss() >= 60)
return "gibbers, \"[text]\""; return "gibbers, [text]";
if (ending == "?") if (ending == "?")
return "asks, \"[text]\""; return "asks, [text]";
if (ending == "!") if (ending == "!")
return "exclaims, \"[text]\""; return "exclaims, [text]";
// if(dna) // if(dna)
// return "[dna.species.say_mod], \"[text]\""; // return "[dna.species.say_mod], \"[text]\"";
return "says, \"[text]\""; return "says, [text]";
/mob/living/carbon/human/treat_speech(var/datum/speech/speech, var/genesay=0) /mob/living/carbon/human/treat_speech(var/datum/speech/speech, var/genesay=0)
if(wear_mask && istype(wear_mask)) if(wear_mask && istype(wear_mask))

View File

@@ -5,11 +5,11 @@
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (ending == "?") if (ending == "?")
return "telepathically asks, \"[text]\""; return "telepathically asks, [text]";
else if (ending == "!") else if (ending == "!")
return "telepathically cries, \"[text]\""; return "telepathically cries, [text]";
return "telepathically chirps, \"[text]\""; return "telepathically chirps, [text]";
/mob/living/carbon/slime/Hear(var/datum/speech/speech, var/rendered_speech="") /mob/living/carbon/slime/Hear(var/datum/speech/speech, var/rendered_speech="")
if(speech.speaker && speech.speaker != src && !speech.frequency) if(speech.speaker && speech.speaker != src && !speech.frequency)

View File

@@ -1,5 +1,5 @@
/mob/living/carbon/monkey/say_quote(var/text) /mob/living/carbon/monkey/say_quote(var/text)
return "chimpers, \"[text]\""; return "chimpers, [text]";
/mob/living/carbon/monkey/say_understands(var/mob/other,var/datum/language/speaking = null) /mob/living/carbon/monkey/say_understands(var/mob/other,var/datum/language/speaking = null)
if(other) other = other.GetSource() if(other) other = other.GetSource()

View File

@@ -178,8 +178,10 @@ var/list/department_radio_keys = list(
speech.message = trim_left(speech.message) speech.message = trim_left(speech.message)
if(handle_inherent_channels(speech, message_mode)) if(handle_inherent_channels(speech, message_mode))
say_testing(src, "Handled by inherent channel") say_testing(src, "Handled by inherent channel")
returnToPool(speech)
return return
if(!can_speak_vocal(speech.message)) if(!can_speak_vocal(speech.message))
returnToPool(speech)
return return
//parse the language code and consume it //parse the language code and consume it
@@ -189,6 +191,7 @@ var/list/department_radio_keys = list(
treat_speech(speech) treat_speech(speech)
var/radio_return = radio(speech, message_mode) var/radio_return = radio(speech, message_mode)
if(radio_return & NOPASS) //There's a whisper() message_mode, no need to continue the proc if that is called if(radio_return & NOPASS) //There's a whisper() message_mode, no need to continue the proc if that is called
returnToPool(speech)
return return
if(radio_return & ITALICS) if(radio_return & ITALICS)
@@ -399,9 +402,9 @@ var/list/department_radio_keys = list(
/mob/living/say_quote() /mob/living/say_quote()
if (stuttering) if (stuttering)
return "stammers, \"[text]\"" return "stammers, [text]"
if (getBrainLoss() >= 60) if (getBrainLoss() >= 60)
return "gibbers, \"[text]\"" return "gibbers, [text]"
return ..() return ..()
/mob/living/proc/send_speech_bubble(var/message,var/bubble_type, var/list/hearers) /mob/living/proc/send_speech_bubble(var/message,var/bubble_type, var/list/hearers)

View File

@@ -38,11 +38,11 @@
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (ending == "?") if (ending == "?")
return "queries, \"[text]\""; return "queries, [text]";
else if (ending == "!") else if (ending == "!")
return "declares, \"[text]\""; return "declares, [text]";
return "states, \"[text]\""; return "states, [text]";
/mob/living/silicon/ai/IsVocal() /mob/living/silicon/ai/IsVocal()
return !config.silent_ai return !config.silent_ai

View File

@@ -15,8 +15,8 @@
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (ending == "?") if (ending == "?")
return "queries, \"[text]\""; return "queries, [text]";
else if (ending == "!") else if (ending == "!")
return "declares, \"[copytext(text, 1, length(text))]\""; return "declares, [copytext(text, 1, length(text))]";
return "states, \"[text]\""; return "states, [text]";

View File

@@ -2,11 +2,11 @@
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (ending == "?") if (ending == "?")
return "queries, \"[text]\""; return "queries, [text]";
else if (ending == "!") else if (ending == "!")
return "declares, \"[text]\""; return "declares, [text]";
return "states, \"[text]\""; return "states, [text]";
/mob/living/silicon/robot/mommi/handle_inherent_channels(var/datum/speech/speech, var/message_mode) /mob/living/silicon/robot/mommi/handle_inherent_channels(var/datum/speech/speech, var/message_mode)
. = ..() . = ..()

View File

@@ -2,11 +2,11 @@
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (ending == "?") if (ending == "?")
return "[src.speakQuery], \"[text]\""; return "[src.speakQuery], [text]";
else if (ending == "!") else if (ending == "!")
return "[src.speakExclamation], \"[text]\""; return "[src.speakExclamation], [text]";
return "[src.speakStatement], \"[text]\""; return "[src.speakStatement], [text]";
/mob/living/silicon/pai/say(var/msg) /mob/living/silicon/pai/say(var/msg)
if(silence_time) if(silence_time)

View File

@@ -2,11 +2,11 @@
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (ending == "?") if (ending == "?")
return "queries, \"[text]\""; return "queries, [text]";
else if (ending == "!") else if (ending == "!")
return "declares, \"[text]\""; return "declares, [text]";
return "states, \"[text]\""; return "states, [text]";
/mob/living/silicon/say(var/message) /mob/living/silicon/say(var/message)
return ..(message, "R") return ..(message, "R")

View File

@@ -197,7 +197,7 @@
/mob/living/simple_animal/mouse/say_quote(text) /mob/living/simple_animal/mouse/say_quote(text)
if(!text) if(!text)
return "squeaks, \"...\""; //not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code return "squeaks, \"...\""; //not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code
return "squeaks, \"[text]\""; return "squeaks, [text]";
/mob/living/simple_animal/mouse/singularity_act() /mob/living/simple_animal/mouse/singularity_act()
if(!(src.flags & INVULNERABLE)) if(!(src.flags & INVULNERABLE))

View File

@@ -297,8 +297,8 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
if(speak_emote && speak_emote.len) if(speak_emote && speak_emote.len)
var/emote = pick(speak_emote) var/emote = pick(speak_emote)
if(emote) if(emote)
return "[emote], \"[text]\"" return "[emote], [text]"
return "says, \"[text]\""; return "says, [text]";
/mob/living/simple_animal/emote(var/act, var/type, var/desc) /mob/living/simple_animal/emote(var/act, var/type, var/desc)
if(timestopped) return //under effects of time magick if(timestopped) return //under effects of time magick

View File

@@ -57,7 +57,7 @@
if(name != real_name) if(name != real_name)
alt_name = " (died as [real_name])" alt_name = " (died as [real_name])"
message = src.say_quote(message) message = src.say_quote(html_encode(message))
//var/rendered = "<span class='game deadsay'><span class='prefix'>DEAD:</span> <span class='name'>[name]</span>[alt_name] <span class='message'>[message]</span></span>" //var/rendered = "<span class='game deadsay'><span class='prefix'>DEAD:</span> <span class='name'>[name]</span>[alt_name] <span class='message'>[message]</span></span>"
var/rendered2 = null//edited var/rendered2 = null//edited
for(var/mob/M in player_list) for(var/mob/M in player_list)