Add ERT time stats (#31629)

* add jobs for ghost roles

* add job to ToggleableGhostRole

* typo

---------

Co-authored-by: Mota <belochuc@gmail.com>
This commit is contained in:
poeMota
2024-09-02 08:32:49 +03:00
committed by GitHub
parent 738e0cf0df
commit 9a51d37d02
6 changed files with 41 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ using Content.Server.Popups;
using Content.Shared.Verbs;
using Robust.Shared.Collections;
using Content.Shared.Ghost.Roles.Components;
using Content.Shared.Roles.Jobs;
namespace Content.Server.Ghost.Roles;
@@ -599,6 +600,14 @@ public sealed class GhostRoleSystem : EntitySystem
if (!TryComp(uid, out GhostRoleComponent? ghostRole))
return;
if (ghostRole.JobProto != null)
{
if (HasComp<JobComponent>(args.Mind))
_roleSystem.MindRemoveRole<JobComponent>(args.Mind);
_roleSystem.MindAddRole(args.Mind, new JobComponent { Prototype = ghostRole.JobProto });
}
ghostRole.Taken = true;
UnregisterGhostRole((uid, ghostRole));
}