Skip to content

Commit

Permalink
[BUGFIX] "Ghost" in the lobby lets you see the whole chat (#33529)
Browse files Browse the repository at this point in the history
* fix bug, in ghost command lobby

* fix

* Fix build
  • Loading branch information
Schrodinger71 authored Nov 25, 2024
1 parent ed2cd23 commit f53e3ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Content.Server/Ghost/GhostCommand.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -23,6 +25,14 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
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))
{
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/chat/commands/ghost-command.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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!

0 comments on commit f53e3ec

Please sign in to comment.