Small identity fixes (#9617)
This commit is contained in:
@@ -21,7 +21,7 @@ public class IdentitySystem : SharedIdentitySystem
|
|||||||
[Dependency] private readonly IdCardSystem _idCard = default!;
|
[Dependency] private readonly IdCardSystem _idCard = default!;
|
||||||
[Dependency] private readonly IAdminLogManager _adminLog = default!;
|
[Dependency] private readonly IAdminLogManager _adminLog = default!;
|
||||||
|
|
||||||
private Queue<EntityUid> _queuedIdentityUpdates = new();
|
private HashSet<EntityUid> _queuedIdentityUpdates = new();
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -37,13 +37,15 @@ public class IdentitySystem : SharedIdentitySystem
|
|||||||
{
|
{
|
||||||
base.Update(frameTime);
|
base.Update(frameTime);
|
||||||
|
|
||||||
while (_queuedIdentityUpdates.TryDequeue(out var ent))
|
foreach (var ent in _queuedIdentityUpdates)
|
||||||
{
|
{
|
||||||
if (!TryComp<IdentityComponent>(ent, out var identity))
|
if (!TryComp<IdentityComponent>(ent, out var identity))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
UpdateIdentityInfo(ent, identity);
|
UpdateIdentityInfo(ent, identity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_queuedIdentityUpdates.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is where the magic happens
|
// This is where the magic happens
|
||||||
@@ -62,7 +64,7 @@ public class IdentitySystem : SharedIdentitySystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void QueueIdentityUpdate(EntityUid uid)
|
public void QueueIdentityUpdate(EntityUid uid)
|
||||||
{
|
{
|
||||||
_queuedIdentityUpdates.Enqueue(uid);
|
_queuedIdentityUpdates.Add(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Private API
|
#region Private API
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ using Content.Shared.Roles;
|
|||||||
using Content.Server.Traitor;
|
using Content.Server.Traitor;
|
||||||
using Content.Shared.Zombies;
|
using Content.Shared.Zombies;
|
||||||
using Content.Server.Atmos.Miasma;
|
using Content.Server.Atmos.Miasma;
|
||||||
|
using Content.Server.IdentityManagement;
|
||||||
|
|
||||||
namespace Content.Server.Zombies
|
namespace Content.Server.Zombies
|
||||||
{
|
{
|
||||||
@@ -45,6 +46,7 @@ namespace Content.Server.Zombies
|
|||||||
[Dependency] private readonly ServerInventorySystem _serverInventory = default!;
|
[Dependency] private readonly ServerInventorySystem _serverInventory = default!;
|
||||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||||
[Dependency] private readonly SharedHumanoidAppearanceSystem _sharedHuApp = default!;
|
[Dependency] private readonly SharedHumanoidAppearanceSystem _sharedHuApp = default!;
|
||||||
|
[Dependency] private readonly IdentitySystem _identity = default!;
|
||||||
[Dependency] private readonly IChatManager _chatMan = default!;
|
[Dependency] private readonly IChatManager _chatMan = default!;
|
||||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||||
|
|
||||||
@@ -158,6 +160,8 @@ namespace Content.Server.Zombies
|
|||||||
if (TryComp<MetaDataComponent>(target, out var meta))
|
if (TryComp<MetaDataComponent>(target, out var meta))
|
||||||
meta.EntityName = Loc.GetString("zombie-name-prefix", ("target", meta.EntityName));
|
meta.EntityName = Loc.GetString("zombie-name-prefix", ("target", meta.EntityName));
|
||||||
|
|
||||||
|
_identity.QueueIdentityUpdate(target);
|
||||||
|
|
||||||
//He's gotta have a mind
|
//He's gotta have a mind
|
||||||
var mindcomp = EnsureComp<MindComponent>(target);
|
var mindcomp = EnsureComp<MindComponent>(target);
|
||||||
if (mindcomp.Mind != null && mindcomp.Mind.TryGetSession(out var session))
|
if (mindcomp.Mind != null && mindcomp.Mind.TryGetSession(out var session))
|
||||||
|
|||||||
Reference in New Issue
Block a user