[fix?] you can`t re/call when you not on station

# Conflicts:
#	Content.Server/Communications/CommunicationsConsoleSystem.cs
This commit is contained in:
rhailrake
2023-04-27 06:07:22 +06:00
committed by Remuchi
parent cd6483a665
commit 4e5232f0f2

View File

@@ -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<BecomesStationComponent>(parent));
}
}
/// <summary>