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

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