Clean up store system (#28463)

This commit is contained in:
Nemanja
2024-06-01 11:29:17 -04:00
committed by GitHub
parent 19be94c9ea
commit be6f55a090
26 changed files with 127 additions and 209 deletions

View File

@@ -8,6 +8,7 @@ using Content.Server.PDA.Ringer;
using Content.Server.Station.Systems;
using Content.Server.Store.Components;
using Content.Server.Store.Systems;
using Content.Server.Traitor.Uplink;
using Content.Shared.Access.Components;
using Content.Shared.CartridgeLoader;
using Content.Shared.Chat;
@@ -15,6 +16,7 @@ using Content.Shared.Light;
using Content.Shared.Light.Components;
using Content.Shared.Light.EntitySystems;
using Content.Shared.PDA;
using Content.Shared.Store.Components;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
@@ -152,7 +154,7 @@ namespace Content.Server.PDA
var address = GetDeviceNetAddress(uid);
var hasInstrument = HasComp<InstrumentComponent>(uid);
var showUplink = HasComp<StoreComponent>(uid) && IsUnlocked(uid);
var showUplink = HasComp<UplinkComponent>(uid) && IsUnlocked(uid);
UpdateStationName(uid, pda);
UpdateAlertLevel(uid, pda);
@@ -237,8 +239,8 @@ namespace Content.Server.PDA
return;
// check if its locked again to prevent malicious clients opening locked uplinks
if (TryComp<StoreComponent>(uid, out var store) && IsUnlocked(uid))
_store.ToggleUi(msg.Actor, uid, store);
if (HasComp<UplinkComponent>(uid) && IsUnlocked(uid))
_store.ToggleUi(msg.Actor, uid);
}
private void OnUiMessage(EntityUid uid, PdaComponent pda, PdaLockUplinkMessage msg)