This commit is contained in:
ShadowCommander
2023-03-26 11:31:13 -07:00
committed by GitHub
parent 0e5dc41fe8
commit bfc4da9377
85 changed files with 1150 additions and 684 deletions

View File

@@ -29,7 +29,7 @@ namespace Content.Server.Chat.Commands
var mind = player.ContentData()?.Mind;
// This check also proves mind not-null for at the end when the mob is ghosted.
if (mind?.OwnedComponent?.Owner is not { Valid: true } victim)
if (mind?.OwnedEntity is not { Valid: true } victim)
{
shell.WriteLine("You don't have a mind!");
return;

View File

@@ -116,19 +116,19 @@ namespace Content.Server.Chat.Managers
ChatMessageToMany(ChatChannel.AdminAlert, message, wrappedMessage, default, false, true, clients);
}
public void SendAdminAlert(EntityUid player, string message, MindComponent? mindComponent = null)
public void SendAdminAlert(EntityUid player, string message, MindContainerComponent? mindContainerComponent = null)
{
if(mindComponent == null && !_entityManager.TryGetComponent(player, out mindComponent))
if(mindContainerComponent == null && !_entityManager.TryGetComponent(player, out mindContainerComponent))
{
SendAdminAlert(message);
return;
}
var adminSystem = _entityManager.System<AdminSystem>();
var antag = mindComponent.Mind!.UserId != null
&& (adminSystem.GetCachedPlayerInfo(mindComponent.Mind!.UserId.Value)?.Antag ?? false);
var antag = mindContainerComponent.Mind!.UserId != null
&& (adminSystem.GetCachedPlayerInfo(mindContainerComponent.Mind!.UserId.Value)?.Antag ?? false);
SendAdminAlert($"{mindComponent.Mind!.Session?.Name}{(antag ? " (ANTAG)" : "")} {message}");
SendAdminAlert($"{mindContainerComponent.Mind!.Session?.Name}{(antag ? " (ANTAG)" : "")} {message}");
}
public void SendHookOOC(string sender, string message)

View File

@@ -24,7 +24,7 @@ namespace Content.Server.Chat.Managers
void SendHookOOC(string sender, string message);
void SendAdminAnnouncement(string message);
void SendAdminAlert(string message);
void SendAdminAlert(EntityUid player, string message, MindComponent? mindComponent = null);
void SendAdminAlert(EntityUid player, string message, MindContainerComponent? mindContainerComponent = null);
void ChatMessageToOne(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat,
INetChannel client, Color? colorOverride = null, bool recordReplay = false, string? audioPath = null, float audioVolume = 0);

View File

@@ -497,9 +497,9 @@ public sealed partial class ChatSystem : SharedChatSystem
if (player == null)
return true;
var mindComponent = player.ContentData()?.Mind;
var mindContainerComponent = player.ContentData()?.Mind;
if (mindComponent == null)
if (mindContainerComponent == null)
{
shell?.WriteError("You don't have a mind!");
return false;