diff --git a/Content.Server/IdentityManagement/IdentitySystem.cs b/Content.Server/IdentityManagement/IdentitySystem.cs index bc50d62e02..9a11a2073e 100644 --- a/Content.Server/IdentityManagement/IdentitySystem.cs +++ b/Content.Server/IdentityManagement/IdentitySystem.cs @@ -21,7 +21,7 @@ public class IdentitySystem : SharedIdentitySystem [Dependency] private readonly IdCardSystem _idCard = default!; [Dependency] private readonly IAdminLogManager _adminLog = default!; - private Queue _queuedIdentityUpdates = new(); + private HashSet _queuedIdentityUpdates = new(); public override void Initialize() { @@ -37,13 +37,15 @@ public class IdentitySystem : SharedIdentitySystem { base.Update(frameTime); - while (_queuedIdentityUpdates.TryDequeue(out var ent)) + foreach (var ent in _queuedIdentityUpdates) { if (!TryComp(ent, out var identity)) continue; UpdateIdentityInfo(ent, identity); } + + _queuedIdentityUpdates.Clear(); } // This is where the magic happens @@ -62,7 +64,7 @@ public class IdentitySystem : SharedIdentitySystem /// public void QueueIdentityUpdate(EntityUid uid) { - _queuedIdentityUpdates.Enqueue(uid); + _queuedIdentityUpdates.Add(uid); } #region Private API diff --git a/Content.Server/Zombies/ZombifyOnDeathSystem.cs b/Content.Server/Zombies/ZombifyOnDeathSystem.cs index 51b181f3b2..63d4571125 100644 --- a/Content.Server/Zombies/ZombifyOnDeathSystem.cs +++ b/Content.Server/Zombies/ZombifyOnDeathSystem.cs @@ -28,6 +28,7 @@ using Content.Shared.Roles; using Content.Server.Traitor; using Content.Shared.Zombies; using Content.Server.Atmos.Miasma; +using Content.Server.IdentityManagement; namespace Content.Server.Zombies { @@ -45,6 +46,7 @@ namespace Content.Server.Zombies [Dependency] private readonly ServerInventorySystem _serverInventory = default!; [Dependency] private readonly DamageableSystem _damageable = default!; [Dependency] private readonly SharedHumanoidAppearanceSystem _sharedHuApp = default!; + [Dependency] private readonly IdentitySystem _identity = default!; [Dependency] private readonly IChatManager _chatMan = default!; [Dependency] private readonly IPrototypeManager _proto = default!; @@ -75,7 +77,7 @@ namespace Content.Server.Zombies /// /// ALRIGHT BIG BOY. YOU'VE COME TO THE LAYER OF THE BEAST. THIS IS YOUR WARNING. /// This function is the god function for zombie stuff, and it is cursed. I have - /// attempted to label everything thouroughly for your sanity. I have attempted to + /// attempted to label everything thouroughly for your sanity. I have attempted to /// rewrite this, but this is how it shall lie eternal. Turn back now. /// -emo /// @@ -158,6 +160,8 @@ namespace Content.Server.Zombies if (TryComp(target, out var meta)) meta.EntityName = Loc.GetString("zombie-name-prefix", ("target", meta.EntityName)); + _identity.QueueIdentityUpdate(target); + //He's gotta have a mind var mindcomp = EnsureComp(target); if (mindcomp.Mind != null && mindcomp.Mind.TryGetSession(out var session)) @@ -178,7 +182,7 @@ namespace Content.Server.Zombies } ///Goes through every hand, drops the items in it, then removes the hand - ///may become the source of various bugs. + ///may become the source of various bugs. foreach (var hand in _sharedHands.EnumerateHands(target)) { _sharedHands.SetActiveHand(target, hand);