From ae213066b1adb0bc68742b740b39d7d135e6e679 Mon Sep 17 00:00:00 2001 From: Errant <35878406+Errant-4@users.noreply.github.com> Date: Tue, 21 Jan 2025 23:48:07 +0100 Subject: [PATCH] HOTFIX Admin playerlist character update fix (#34560) fix IdentityChangedEvent subscription --- Content.Server/Administration/Systems/AdminSystem.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Content.Server/Administration/Systems/AdminSystem.cs b/Content.Server/Administration/Systems/AdminSystem.cs index 1d8c278584e6..eb29617f4974 100644 --- a/Content.Server/Administration/Systems/AdminSystem.cs +++ b/Content.Server/Administration/Systems/AdminSystem.cs @@ -82,13 +82,14 @@ public override void Initialize() Subs.CVar(_config, CCVars.PanicBunkerMinAccountAge, OnPanicBunkerMinAccountAgeChanged, true); Subs.CVar(_config, CCVars.PanicBunkerMinOverallMinutes, OnPanicBunkerMinOverallMinutesChanged, true); - SubscribeLocalEvent(OnIdentityChanged); SubscribeLocalEvent(OnPlayerAttached); SubscribeLocalEvent(OnPlayerDetached); SubscribeLocalEvent(OnRoleEvent); SubscribeLocalEvent(OnRoleEvent); SubscribeLocalEvent(OnRoundRestartCleanup); + SubscribeLocalEvent(OnPlayerRenamed); + SubscribeLocalEvent(OnIdentityChanged); } private void OnRoundRestartCleanup(RoundRestartCleanupEvent ev) @@ -144,12 +145,9 @@ public void UpdatePlayerList(ICommonSession player) return value ?? null; } - private void OnIdentityChanged(ref IdentityChangedEvent ev) + private void OnIdentityChanged(Entity ent, ref IdentityChangedEvent ev) { - if (!TryComp(ev.CharacterEntity, out var actor)) - return; - - UpdatePlayerList(actor.PlayerSession); + UpdatePlayerList(ent.Comp.PlayerSession); } private void OnRoleEvent(RoleEvent ev)