From 744779d5791d30c63d037fc122255a3a744a644e Mon Sep 17 00:00:00 2001 From: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> Date: Sat, 13 Aug 2022 17:00:18 +0700 Subject: [PATCH] Fixing visible message being visible even if the mob is in the object (#18761) * Fixing visible message being visible even if the mob is in the object * Changing visible message logic to show action if you are in the same object * Update code/modules/mob/mob.dm Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> --- code/modules/mob/mob.dm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index c76411126ac..96db4b648d0 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -106,6 +106,19 @@ // blind_message (optional) is what blind people will hear e.g. "You hear something!" /mob/visible_message(message, self_message, blind_message) + if(!isturf(loc)) // mobs inside objects (such as lockers) shouldn't have their actions visible to those outside the object + for(var/mob/M in get_mobs_in_view(3, src)) + if(M.see_invisible < invisibility) + continue //can't view the invisible + var/msg = message + if(self_message && M == src) + msg = self_message + if(M.loc != loc) + if(!blind_message) // for some reason VISIBLE action has blind_message param so if we are not in the same object but next to it, lets show it + continue + msg = blind_message + M.show_message(msg, EMOTE_VISIBLE, blind_message, EMOTE_AUDIBLE) + return for(var/mob/M in get_mobs_in_view(7, src)) if(M.see_invisible < invisibility) continue //can't view the invisible