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