[fix?] you can`t re/call when you not on station
# Conflicts: # Content.Server/Communications/CommunicationsConsoleSystem.cs
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user