From 786788ca568273a91d75c7feac577625f5dc1741 Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Thu, 25 Feb 2021 14:41:20 +0100
Subject: [PATCH] [MIRROR] Allows ghosts to start messages with asterisks in
deadchat again (#3644)
* Allows ghosts to start messages with asterisks in deadchat again (#57159)
#56519 had noble goals in trying to make emote code more robust for
ghosts, but in doing so it undid #47144, which was made to allow people
to start messages with asterisks in deadchat without getting hassled by
the game thinking you're emoting. This re-limits the emote checker to
the only two emotes ghosts have ever had, *spin and *flip.
* Allows ghosts to start messages with asterisks in deadchat again
Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
---
code/datums/brain_damage/split_personality.dm | 2 +-
code/modules/mob/camera/camera.dm | 2 +-
code/modules/mob/dead/observer/observer_say.dm | 5 +----
code/modules/mob/emote.dm | 6 +++---
code/modules/mob/living/simple_animal/simple_animal.dm | 2 +-
5 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/code/datums/brain_damage/split_personality.dm b/code/datums/brain_damage/split_personality.dm
index 5aef72ae16c..c058173ba39 100644
--- a/code/datums/brain_damage/split_personality.dm
+++ b/code/datums/brain_damage/split_personality.dm
@@ -157,7 +157,7 @@
to_chat(src, "You cannot speak, your other self is controlling your body!")
return FALSE
-/mob/living/split_personality/emote(act, m_type = null, message = null, intentional = FALSE)
+/mob/living/split_personality/emote(act, m_type = null, message = null, intentional = FALSE, force_silence = FALSE)
return FALSE
///////////////BRAINWASHING////////////////////
diff --git a/code/modules/mob/camera/camera.dm b/code/modules/mob/camera/camera.dm
index 8fb3cb17eab..a36e062a87d 100644
--- a/code/modules/mob/camera/camera.dm
+++ b/code/modules/mob/camera/camera.dm
@@ -23,5 +23,5 @@
/mob/camera/canUseStorage()
return FALSE
-/mob/camera/emote(act, m_type=1, message = null, intentional = FALSE)
+/mob/camera/emote(act, m_type=1, message = null, intentional = FALSE, force_silence = FALSE)
return FALSE
diff --git a/code/modules/mob/dead/observer/observer_say.dm b/code/modules/mob/dead/observer/observer_say.dm
index fb6244958be..fcb8b7994c4 100644
--- a/code/modules/mob/dead/observer/observer_say.dm
+++ b/code/modules/mob/dead/observer/observer_say.dm
@@ -1,8 +1,5 @@
/mob/dead/observer/check_emote(message, forced)
- if(message[1] == "*")
- emote(copytext(message, length(message[1]) + 1), intentional = !forced)
- return TRUE
-
+ return emote(copytext(message, length(message[1]) + 1), intentional = !forced, force_silence = TRUE)
//Modified version of get_message_mods, removes the trimming, the only thing we care about here is admin channels
/mob/dead/observer/get_message_mods(message, list/mods)
diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm
index bf460298d2d..59167b77d9b 100644
--- a/code/modules/mob/emote.dm
+++ b/code/modules/mob/emote.dm
@@ -6,7 +6,7 @@
#define BEYBLADE_CONFUSION_LIMIT 40 //A max for how penalized a carbon will be for beyblading
//The code execution of the emote datum is located at code/datums/emotes.dm
-/mob/proc/emote(act, m_type = null, message = null, intentional = FALSE)
+/mob/proc/emote(act, m_type = null, message = null, intentional = FALSE, force_silence = FALSE)
act = lowertext(act)
var/param = message
var/custom_param = findchar(act, " ")
@@ -17,7 +17,7 @@
var/list/key_emotes = GLOB.emote_list[act]
if(!length(key_emotes))
- if(intentional)
+ if(intentional && !force_silence)
to_chat(src, "'[act]' emote does not exist. Say *help for a list.")
return FALSE
var/silenced = FALSE
@@ -28,7 +28,7 @@
if(P.run_emote(src, param, m_type, intentional))
SEND_SIGNAL(src, COMSIG_MOB_EMOTE, P, act, m_type, message, intentional)
return TRUE
- if(intentional && !silenced)
+ if(intentional && !silenced && !force_silence)
to_chat(src, "Unusable emote '[act]'. Say *help for a list.")
return FALSE
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index 983a5678ecc..cc857f2022d 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -457,7 +457,7 @@
return ..()
-/mob/living/simple_animal/emote(act, m_type=1, message = null, intentional = FALSE)
+/mob/living/simple_animal/emote(act, m_type=1, message = null, intentional = FALSE, force_silence = FALSE)
if(stat)
return FALSE
return ..()