]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Non-uplink PDAs no longer can have TC inserted into them (#28985)
authorZonespace <41448081+Zonespace27@users.noreply.github.com>
Fri, 14 Jun 2024 15:24:40 +0000 (17:24 +0200)
committerGitHub <noreply@github.com>
Fri, 14 Jun 2024 15:24:40 +0000 (11:24 -0400)
* PDAs no longer can have TC inserted into them

* far better way of doing this

---------

Co-authored-by: John Doe <johndoe@gmail.com>
Content.Server/PDA/Ringer/RingerSystem.cs
Content.Server/Store/Systems/StoreSystem.cs

index e15dcfaa2bc7c9f8cbc6c882462931b45e6c51ff..0cc4ea86c2210b9790168854d7a27aa44cc5f1bf 100644 (file)
@@ -43,13 +43,19 @@ namespace Content.Server.PDA.Ringer
             SubscribeLocalEvent<RingerComponent, RingerPlayRingtoneMessage>(RingerPlayRingtone);
             SubscribeLocalEvent<RingerComponent, RingerRequestUpdateInterfaceMessage>(UpdateRingerUserInterfaceDriver);
 
-            SubscribeLocalEvent<RingerUplinkComponent, CurrencyInsertAttemptEvent>(OnCurrencyInsert);
+            SubscribeLocalEvent<RingerComponent, CurrencyInsertAttemptEvent>(OnCurrencyInsert);
         }
 
         //Event Functions
 
-        private void OnCurrencyInsert(EntityUid uid, RingerUplinkComponent uplink, CurrencyInsertAttemptEvent args)
+        private void OnCurrencyInsert(EntityUid uid, RingerComponent ringer, CurrencyInsertAttemptEvent args)
         {
+            if (!TryComp<RingerUplinkComponent>(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();
index 0fd92cfb96516a4b010c5082b3015bf8b6bc723d..c13a9583beb0f34dc439ef65d351c55640510899 100644 (file)
@@ -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;