HOTFIX Admin playerlist character update fix (#34560)
fix IdentityChangedEvent subscription
This commit is contained in:
@@ -82,13 +82,14 @@ public sealed class AdminSystem : EntitySystem
|
|||||||
Subs.CVar(_config, CCVars.PanicBunkerMinAccountAge, OnPanicBunkerMinAccountAgeChanged, true);
|
Subs.CVar(_config, CCVars.PanicBunkerMinAccountAge, OnPanicBunkerMinAccountAgeChanged, true);
|
||||||
Subs.CVar(_config, CCVars.PanicBunkerMinOverallMinutes, OnPanicBunkerMinOverallMinutesChanged, true);
|
Subs.CVar(_config, CCVars.PanicBunkerMinOverallMinutes, OnPanicBunkerMinOverallMinutesChanged, true);
|
||||||
|
|
||||||
SubscribeLocalEvent<IdentityChangedEvent>(OnIdentityChanged);
|
|
||||||
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
|
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
|
||||||
SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);
|
SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);
|
||||||
SubscribeLocalEvent<RoleAddedEvent>(OnRoleEvent);
|
SubscribeLocalEvent<RoleAddedEvent>(OnRoleEvent);
|
||||||
SubscribeLocalEvent<RoleRemovedEvent>(OnRoleEvent);
|
SubscribeLocalEvent<RoleRemovedEvent>(OnRoleEvent);
|
||||||
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestartCleanup);
|
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestartCleanup);
|
||||||
|
|
||||||
SubscribeLocalEvent<ActorComponent, EntityRenamedEvent>(OnPlayerRenamed);
|
SubscribeLocalEvent<ActorComponent, EntityRenamedEvent>(OnPlayerRenamed);
|
||||||
|
SubscribeLocalEvent<ActorComponent, IdentityChangedEvent>(OnIdentityChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnRoundRestartCleanup(RoundRestartCleanupEvent ev)
|
private void OnRoundRestartCleanup(RoundRestartCleanupEvent ev)
|
||||||
@@ -144,12 +145,9 @@ public sealed class AdminSystem : EntitySystem
|
|||||||
return value ?? null;
|
return value ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnIdentityChanged(ref IdentityChangedEvent ev)
|
private void OnIdentityChanged(Entity<ActorComponent> ent, ref IdentityChangedEvent ev)
|
||||||
{
|
{
|
||||||
if (!TryComp<ActorComponent>(ev.CharacterEntity, out var actor))
|
UpdatePlayerList(ent.Comp.PlayerSession);
|
||||||
return;
|
|
||||||
|
|
||||||
UpdatePlayerList(actor.PlayerSession);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnRoleEvent(RoleEvent ev)
|
private void OnRoleEvent(RoleEvent ev)
|
||||||
|
|||||||
Reference in New Issue
Block a user