diff --git a/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs b/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs index c501025fe9..1a8314011d 100644 --- a/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs +++ b/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs @@ -80,7 +80,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem public IEnumerable GetTimedRoles(EntityUid mindId) { var ev = new MindGetAllRolesEvent(new List()); - RaiseLocalEvent(ref ev); + RaiseLocalEvent(mindId, ref ev); foreach (var role in ev.Roles) { diff --git a/Content.Server/Roles/MindGetAllRolesEvent.cs b/Content.Server/Roles/MindGetAllRolesEvent.cs index bdbfb49fc3..dd66197403 100644 --- a/Content.Server/Roles/MindGetAllRolesEvent.cs +++ b/Content.Server/Roles/MindGetAllRolesEvent.cs @@ -16,4 +16,4 @@ public readonly record struct MindGetAllRolesEvent(List Roles); /// Name of the role. /// Whether or not this role makes this player an antagonist. /// The id associated with the role. -public readonly record struct RoleInfo(Component Component, string Name, bool Antagonist, string? PlayTimeTrackerId = null); +public readonly record struct RoleInfo(Component Component, string Name, bool Antagonist, string? PlayTimeTrackerId); diff --git a/Content.Server/Roles/RoleSystem.cs b/Content.Server/Roles/RoleSystem.cs index c63a44155f..151a3b21b1 100644 --- a/Content.Server/Roles/RoleSystem.cs +++ b/Content.Server/Roles/RoleSystem.cs @@ -30,14 +30,16 @@ public sealed class RoleSystem : EntitySystem private void OnJobGetAllRoles(EntityUid uid, JobComponent component, ref MindGetAllRolesEvent args) { var name = "game-ticker-unknown-role"; + string? playTimeTracker = null; if (component.PrototypeId != null && _prototypes.TryIndex(component.PrototypeId, out JobPrototype? job)) { name = job.Name; + playTimeTracker = job.PlayTimeTracker; } name = Loc.GetString(name); - args.Roles.Add(new RoleInfo(component, name, false)); + args.Roles.Add(new RoleInfo(component, name, false, playTimeTracker)); } private void SubscribeAntagEvents() where T : AntagonistRoleComponent @@ -51,7 +53,7 @@ public sealed class RoleSystem : EntitySystem } name = Loc.GetString(name); - args.Roles.Add(new RoleInfo(component, name, true)); + args.Roles.Add(new RoleInfo(component, name, true, null)); }); SubscribeLocalEvent((EntityUid _, T _, ref MindIsAntagonistEvent args) => args.IsAntagonist = true);