fix(GhostRoleAntagSpawner): Create a new mind before transfering (#30354)

* IN MY WALLS! IN MY WALLS THEY ARE IN MY WALLS HELP HEELP HEKP PA DADOEAMD EODM AOM D *DIES* IM NOT DEAD ADADADDADIAMSDIM

* RUN I SAID RUN! THEY TOOK MY UKELELE

Co-authored-by: EmoGarbage404 <retron404@gmail.com>

* Many have fallen

* It's all emo's fault

---------

Co-authored-by: EmoGarbage404 <retron404@gmail.com>
This commit is contained in:
Brandon Hu
2024-08-03 14:09:41 +00:00
committed by GitHub
parent 77eb70ea8a
commit a937f05929

View File

@@ -328,16 +328,13 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
if (session != null) if (session != null)
{ {
var curMind = session.GetMind(); var curMind = _mind.CreateMind(session.UserId, Name(antagEnt.Value));
if (curMind == null) _mind.SetUserId(curMind, session.UserId);
{
curMind = _mind.CreateMind(session.UserId, Name(antagEnt.Value)); _mind.TransferTo(curMind, antagEnt, ghostCheckOverride: true);
_mind.SetUserId(curMind.Value, session.UserId); _role.MindAddRoles(curMind, def.MindComponents, null, true);
} ent.Comp.SelectedMinds.Add((curMind, Name(player)));
_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); SendBriefing(session, def.Briefing);
} }