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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user