From c557923cce48037db7ff412c467361bf3ace80c4 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Sun, 10 Jan 2021 15:52:57 +0100 Subject: [PATCH] Hide deadchat bubbles if the player's mob doesn't have a GhostComponent Fixes #2964 --- Content.Client/Chat/ChatManager.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Content.Client/Chat/ChatManager.cs b/Content.Client/Chat/ChatManager.cs index 07431434ab..96910110f8 100644 --- a/Content.Client/Chat/ChatManager.cs +++ b/Content.Client/Chat/ChatManager.cs @@ -1,11 +1,13 @@ using System.Collections.Generic; using Content.Client.Administration; +using Content.Client.GameObjects.Components.Observer; using Content.Client.Interfaces.Chat; using Content.Shared.Administration; using Content.Shared.Chat; using Robust.Client.Console; using Robust.Client.Interfaces.Graphics.ClientEye; using Robust.Client.Interfaces.UserInterface; +using Robust.Client.Player; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; @@ -25,6 +27,8 @@ namespace Content.Client.Chat { internal sealed class ChatManager : IChatManager, IPostInjectInit { + [Dependency] private IPlayerManager _playerManager = default!; + private struct SpeechBubbleData { public string Message; @@ -387,7 +391,13 @@ namespace Content.Client.Chat switch (msg.Channel) { case ChatChannel.Local: + AddSpeechBubble(msg, SpeechBubble.SpeechType.Say); + break; + case ChatChannel.Dead: + if (!_playerManager.LocalPlayer?.ControlledEntity?.HasComponent() ?? true) + break; + AddSpeechBubble(msg, SpeechBubble.SpeechType.Say); break;