diff --git a/Content.Server/Antag/AntagSelectionSystem.cs b/Content.Server/Antag/AntagSelectionSystem.cs index 64b26509c4..270b39b3a2 100644 --- a/Content.Server/Antag/AntagSelectionSystem.cs +++ b/Content.Server/Antag/AntagSelectionSystem.cs @@ -18,6 +18,7 @@ using Content.Shared.GameTicking; using Content.Shared.GameTicking.Components; using Content.Shared.Ghost; using Content.Shared.Humanoid; +using Content.Shared.Mind; using Content.Shared.Players; using Content.Shared.Preferences.Loadouts; using Content.Shared.Roles; @@ -231,7 +232,7 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem(curMind.Value, out var mindComp) || + mindComp.OwnedEntity != antagEnt) + { + curMind = _mind.CreateMind(session.UserId, Name(antagEnt.Value)); + _mind.SetUserId(curMind.Value, session.UserId); + } + _mind.TransferTo(curMind.Value, antagEnt, ghostCheckOverride: true); + _role.MindAddRoles(curMind.Value, def.MindComponents, null, true); + ent.Comp.SelectedMinds.Add((curMind.Value, Name(player))); SendBriefing(session, def.Briefing); } @@ -460,7 +467,7 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem ent, ref ObjectivesTextGetInfoEvent args) { - if (ent.Comp.AgentName is not {} name) + if (ent.Comp.AgentName is not { } name) return; args.Minds = ent.Comp.SelectedMinds;