From 4e5232f0f249b7ed5e8d0a49cb98285d96b7997b Mon Sep 17 00:00:00 2001 From: rhailrake <49613070+rhailrake@users.noreply.github.com> Date: Thu, 27 Apr 2023 06:07:22 +0600 Subject: [PATCH] [fix?] you can`t re/call when you not on station # Conflicts: # Content.Server/Communications/CommunicationsConsoleSystem.cs --- .../CommunicationsConsoleSystem.cs | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Content.Server/Communications/CommunicationsConsoleSystem.cs b/Content.Server/Communications/CommunicationsConsoleSystem.cs index b2945c2a11..017a539f32 100644 --- a/Content.Server/Communications/CommunicationsConsoleSystem.cs +++ b/Content.Server/Communications/CommunicationsConsoleSystem.cs @@ -7,6 +7,7 @@ using Content.Server.Interaction; using Content.Server.Popups; using Content.Server.RoundEnd; using Content.Server.Shuttles.Systems; +using Content.Server.Station.Components; using Content.Server.Station.Systems; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; @@ -290,8 +291,16 @@ namespace Content.Server.Communications if (!CanCallOrRecall(comp)) return; - if (message.Session.AttachedEntity is not { Valid: true } mob) + if (message.Session.AttachedEntity is not {Valid: true} mob) return; + + //WD-EDIT + if (!OnStationCallOrRecall(uid)) + { + _popupSystem.PopupEntity(Loc.GetString("comms-console-no-connection"), uid, message.Session); + return; + } + //WD-EDIT if (!CanUse(mob, uid)) { @@ -316,9 +325,17 @@ namespace Content.Server.Communications if (!CanCallOrRecall(comp)) return; - if (message.Session.AttachedEntity is not { Valid: true } mob) + if (message.Session.AttachedEntity is not {Valid: true} mob) return; + //WD-EDIT + if (!OnStationCallOrRecall(uid)) + { + _popupSystem.PopupEntity(Loc.GetString("comms-console-no-connection"), uid, message.Session); + return; + } + //WD-EDIT + if (!CanUse(mob, uid)) { _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session); @@ -328,6 +345,13 @@ namespace Content.Server.Communications _roundEndSystem.CancelRoundEndCountdown(uid); _adminLogger.Add(LogType.Action, LogImpact.Extreme, $"{ToPrettyString(mob):player} has recalled the shuttle."); } + + private bool OnStationCallOrRecall(EntityUid uid) + { + var parent = Transform(uid).ParentUid; + return (HasComp(parent)); + + } } ///