Skip to content

Commit

Permalink
Encryption keys Pai fix (#1924)
Browse files Browse the repository at this point in the history
* Encryption keys Pai fix

* maybe?...
  • Loading branch information
Kirus59 committed Sep 23, 2024
1 parent 881684e commit 3cfd9be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Content.Server/Radio/EntitySystems/RadioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,14 @@ private void OnEncryptionChannelsChangeTransmitter(Entity<IntrinsicRadioTransmit

private void OnEncryptionChannelsChangeReceiver(Entity<IntrinsicRadioReceiverComponent> entity, ref EncryptionChannelsChangedEvent args)
{
if (!TryComp<ActiveRadioComponent>(entity.Owner, out var activeRadio))
return;

HashSet<string> channels = entity.Comp.Channels;
HashSet<string> channels = new();
channels.UnionWith(args.Component.Channels);
channels.UnionWith(entity.Comp.Channels);

activeRadio.Channels = new(channels);
if (channels.Count > 0)
EnsureComp<ActiveRadioComponent>(entity.Owner).Channels = channels;
else
RemComp<ActiveRadioComponent>(entity.Owner);
}
//SS220 PAI with encryption keys end
}
3 changes: 3 additions & 0 deletions Resources/Prototypes/SS220/Entities/Objects/Fun/pai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
- type: IntrinsicRadioTransmitter
channels:
- Binary
- type: ActiveRadio
channels:
- Binary
- type: DoAfter
- type: Actions
- type: TypingIndicator
Expand Down

0 comments on commit 3cfd9be

Please sign in to comment.