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();
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;