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 <johndoe@gmail.com>
This commit is contained in:
Zonespace
2024-06-14 17:24:40 +02:00
committed by GitHub
parent 24e7653c98
commit 6d71ec1b14
2 changed files with 10 additions and 4 deletions

View File

@@ -43,13 +43,19 @@ namespace Content.Server.PDA.Ringer
SubscribeLocalEvent<RingerComponent, RingerPlayRingtoneMessage>(RingerPlayRingtone); SubscribeLocalEvent<RingerComponent, RingerPlayRingtoneMessage>(RingerPlayRingtone);
SubscribeLocalEvent<RingerComponent, RingerRequestUpdateInterfaceMessage>(UpdateRingerUserInterfaceDriver); SubscribeLocalEvent<RingerComponent, RingerRequestUpdateInterfaceMessage>(UpdateRingerUserInterfaceDriver);
SubscribeLocalEvent<RingerUplinkComponent, CurrencyInsertAttemptEvent>(OnCurrencyInsert); SubscribeLocalEvent<RingerComponent, CurrencyInsertAttemptEvent>(OnCurrencyInsert);
} }
//Event Functions //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 the store can be locked, it must be unlocked first before inserting currency. Stops traitor checking.
if (!uplink.Unlocked) if (!uplink.Unlocked)
args.Cancel(); args.Cancel();

View File

@@ -5,11 +5,11 @@ using Content.Shared.Implants.Components;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Stacks; using Content.Shared.Stacks;
using Content.Shared.Store.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using System.Linq;
using Content.Shared.Store.Components;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using System.Linq;
namespace Content.Server.Store.Systems; namespace Content.Server.Store.Systems;