From 70f50e78500bdbb8ce39761a7755e2daa7127a02 Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 4 Jan 2014 13:22:06 +0100 Subject: [PATCH] Partial fix for pAI emotes (they still can't hear beyond one container level, will require a say/emote code hack) Conflicts: code/modules/mob/mob_defines.dm --- code/modules/mob/emote.dm | 6 +++++- code/modules/mob/living/silicon/pai/pai.dm | 3 ++- code/modules/mob/mob_defines.dm | 4 +++- code/modules/mob/say.dm | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 416528d3fc0..8a9f2a3b905 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -36,11 +36,15 @@ M.show_message(message) + // Type 1 (Visual) emotes are sent to anyone in view of the item if (m_type & 1) for (var/mob/O in viewers(src, null)) O.show_message(message, m_type) + + // Type 2 (Audible) emotes are sent to anyone in hear range + // of the *LOCATION* -- this is important for pAIs to be heard else if (m_type & 2) - for (var/mob/O in hearers(src.loc, null)) + for (var/mob/O in hearers(get_turf(src), null)) O.show_message(message, m_type) /mob/proc/emote_dead(var/message) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 863708d18c3..02c8ea04223 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -4,6 +4,7 @@ icon_state = "shadow" robot_talk_understand = 0 + emote_type = 2 // pAIs emotes are heard, not seen, so they can be seen through a container (eg. person) var/network = "SS13" var/obj/machinery/camera/current = null @@ -268,4 +269,4 @@ pai.key = src.key card.setPersonality(pai) -*/ \ No newline at end of file +*/ diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index e7a8d3ad79f..99b9a26064e 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -89,6 +89,8 @@ var/list/languages = list() // For speaking/listening. var/list/speak_emote = list("says") //Verbs used when speaking. Defaults to 'say' if speak_emote is null. var/list/abilities = list() // For species-derived or admin-given powers. + var/list/speak_emote = list("says") // Verbs used when speaking. Defaults to 'say' if speak_emote is null. + var/emote_type = 1 // Define emote default type, 1 for seen emotes, 2 for heard emotes var/name_archive //For admin things like possession var/timeofdeath = 0.0//Living @@ -219,4 +221,4 @@ var/turf/listed_turf = null //the current turf being examined in the stat panel - var/kills=0 \ No newline at end of file + var/kills=0 diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 5617e15511f..4ee9e80e26f 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -25,7 +25,7 @@ message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) if(use_me) - usr.emote("me",1,message) + usr.emote("me",usr.emote_type,message) else usr.emote(message)