]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
[BUGFIX] "Ghost" in the lobby lets you see the whole chat (#33529)
authorSchrödinger <132720404+Schrodinger71@users.noreply.github.com>
Mon, 25 Nov 2024 07:20:31 +0000 (07:20 +0000)
committerGitHub <noreply@github.com>
Mon, 25 Nov 2024 07:20:31 +0000 (10:20 +0300)
* fix bug, in ghost command lobby

* fix

* Fix build

Content.Server/Ghost/GhostCommand.cs
Resources/Locale/en-US/chat/commands/ghost-command.ftl

index a2f361d29dbdc29fa69aa42d04d52431d8d3fc4d..26163f6d4d99074d5c556d9ac90e1091dcbd144b 100644 (file)
@@ -1,7 +1,9 @@
 using Content.Server.Popups;
 using Content.Shared.Administration;
+using Content.Shared.GameTicking;
 using Content.Shared.Mind;
 using Robust.Shared.Console;
+using Content.Server.GameTicking;
 
 namespace Content.Server.Ghost
 {
@@ -23,6 +25,14 @@ namespace Content.Server.Ghost
                 return;
             }
 
+            var gameTicker = _entities.System<GameTicker>();
+            if (!gameTicker.PlayerGameStatuses.TryGetValue(player.UserId, out var playerStatus) ||
+                playerStatus is not PlayerGameStatus.JoinedGame)
+            {
+                shell.WriteLine("ghost-command-error-lobby");
+                return;
+            }
+
             if (player.AttachedEntity is { Valid: true } frozen &&
                 _entities.HasComponent<AdminFrozenComponent>(frozen))
             {
index 08e78d34ce5da61a1d4f31ac2fee8efbbc897cea..53dfa478d65cec2d79fc9f050f4b9d29bb35caad 100644 (file)
@@ -3,3 +3,4 @@ ghost-command-help-text = The ghost command turns you into a ghost and makes the
                           Please note that you cannot return to your character's body after ghosting.
 ghost-command-no-session = You have no session, you can't ghost.
 ghost-command-denied = You cannot ghost right now.
+ghost-command-error-lobby = You can't ghost right now. You are not in the game!