Fixed not tracking job playtime (#19639)
This commit is contained in:
@@ -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<T>() 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);
|
||||
|
||||
Reference in New Issue
Block a user