Predict Mind Roles (#39611)

This commit is contained in:
slarticodefast
2025-08-21 03:10:07 +02:00
committed by GitHub
parent b124d0def5
commit 9c546a0072
8 changed files with 53 additions and 63 deletions

View File

@@ -19,11 +19,13 @@ public sealed class ParadoxCloneRoleSystem : EntitySystem
private void OnRefreshNameModifiers(Entity<ParadoxCloneRoleComponent> ent, ref MindRelayedEvent<RefreshNameModifiersEvent> args)
{
if (!TryComp<MindRoleComponent>(ent.Owner, out var roleComp))
var mindId = Transform(ent).ParentUid; // the mind role entity is in a container in the mind entity
if (!TryComp<MindComponent>(mindId, out var mindComp))
return;
// only show for ghosts
if (!HasComp<GhostComponent>(roleComp.Mind.Comp.OwnedEntity))
if (!HasComp<GhostComponent>(mindComp.OwnedEntity))
return;
if (ent.Comp.NameModifier != null)