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:
@@ -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();
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user