fix key debug assert on round restart (#16296)

This commit is contained in:
deltanedas 2023-05-11 03:00:29 +00:00 committed by GitHub
parent 20748cc542
commit 7955183b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -22,7 +22,7 @@ public sealed class HeadsetSystem : SharedHeadsetSystem
SubscribeLocalEvent<HeadsetComponent, EncryptionChannelsChangedEvent>(OnKeysChanged);
SubscribeLocalEvent<WearingHeadsetComponent, EntitySpokeEvent>(OnSpeak);
SubscribeLocalEvent<HeadsetComponent, EmpPulseEvent>(OnEmpPulse);
}
@ -33,7 +33,8 @@ public sealed class HeadsetSystem : SharedHeadsetSystem
private void UpdateRadioChannels(EntityUid uid, HeadsetComponent headset, EncryptionKeyHolderComponent? keyHolder = null)
{
if (!headset.Enabled)
// make sure to not add ActiveRadioComponent when headset is being deleted
if (!headset.Enabled || MetaData(uid).EntityLifeStage >= EntityLifeStage.Terminating)
return;
if (!Resolve(uid, ref keyHolder))