From 6d71ec1b140e48effbc4b6964b809e5244da0f8f Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:24:40 +0200 Subject: [PATCH] Non-uplink PDAs no longer can have TC inserted into them (#28985) * PDAs no longer can have TC inserted into them * far better way of doing this --------- Co-authored-by: John Doe --- Content.Server/PDA/Ringer/RingerSystem.cs | 10 ++++++++-- Content.Server/Store/Systems/StoreSystem.cs | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Content.Server/PDA/Ringer/RingerSystem.cs b/Content.Server/PDA/Ringer/RingerSystem.cs index e15dcfaa2b..0cc4ea86c2 100644 --- a/Content.Server/PDA/Ringer/RingerSystem.cs +++ b/Content.Server/PDA/Ringer/RingerSystem.cs @@ -43,13 +43,19 @@ namespace Content.Server.PDA.Ringer SubscribeLocalEvent(RingerPlayRingtone); SubscribeLocalEvent(UpdateRingerUserInterfaceDriver); - SubscribeLocalEvent(OnCurrencyInsert); + SubscribeLocalEvent(OnCurrencyInsert); } //Event Functions - private void OnCurrencyInsert(EntityUid uid, RingerUplinkComponent uplink, CurrencyInsertAttemptEvent args) + private void OnCurrencyInsert(EntityUid uid, RingerComponent ringer, CurrencyInsertAttemptEvent args) { + if (!TryComp(uid, out var uplink)) + { + args.Cancel(); + return; + } + // if the store can be locked, it must be unlocked first before inserting currency. Stops traitor checking. if (!uplink.Unlocked) args.Cancel(); diff --git a/Content.Server/Store/Systems/StoreSystem.cs b/Content.Server/Store/Systems/StoreSystem.cs index 0fd92cfb96..c13a9583be 100644 --- a/Content.Server/Store/Systems/StoreSystem.cs +++ b/Content.Server/Store/Systems/StoreSystem.cs @@ -5,11 +5,11 @@ using Content.Shared.Implants.Components; using Content.Shared.Interaction; using Content.Shared.Popups; using Content.Shared.Stacks; +using Content.Shared.Store.Components; using JetBrains.Annotations; using Robust.Shared.Prototypes; -using System.Linq; -using Content.Shared.Store.Components; using Robust.Shared.Utility; +using System.Linq; namespace Content.Server.Store.Systems;