Skip to content

Commit

Permalink
Hushed entities' local messages will now be whispers
Browse files Browse the repository at this point in the history
  • Loading branch information
ewokswagger committed Nov 3, 2024
1 parent 009654b commit a38d3fa
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
using Content.Server.Players.RateLimiting;
using Content.Server.Speech.Components;
using Content.Server.Speech.EntitySystems;
using Content.Shared.Speech.Hushing;
using Content.Server.Nyanotrasen.Chat;
using Content.Server.Speech.Components;
using Content.Server.Speech.EntitySystems;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Content.Shared.ActionBlocker;
Expand Down Expand Up @@ -214,11 +213,20 @@ public void TrySendInGameICMessage(
_chatManager.EnsurePlayer(player.UserId).AddEntity(GetNetEntity(source));
}

if (desiredType == InGameICChatType.Speak && message.StartsWith(LocalPrefix))
if (desiredType == InGameICChatType.Speak)
{
// prevent radios and remove prefix.
checkRadioPrefix = false;
message = message[1..];
if (message.StartsWith(LocalPrefix))
{
// prevent radios and remove prefix.
checkRadioPrefix = false;
message = message[1..];
}

if (HasComp<HushedComponent>(source))
{
// hushed players cannot speak on local chat so will be sent as whisper instead
desiredType = InGameICChatType.Whisper;
}
}

bool shouldCapitalize = (desiredType != InGameICChatType.Emote);
Expand Down

0 comments on commit a38d3fa

Please sign in to comment.