]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix(GhostRoleAntagSpawner): Create a new mind before transfering (#30354)
authorBrandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
Sat, 3 Aug 2024 14:09:41 +0000 (14:09 +0000)
committerGitHub <noreply@github.com>
Sat, 3 Aug 2024 14:09:41 +0000 (10:09 -0400)
* 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>
Content.Server/Antag/AntagSelectionSystem.cs

index c9ef237474048e1ab4117be6a31d7d93589b70b7..496fcbb550df3da205282e54fe22df5012b3daab 100644 (file)
@@ -328,16 +328,13 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
 
         if (session != null)
         {
-            var curMind = session.GetMind();
-            if (curMind == null)
-            {
-                curMind = _mind.CreateMind(session.UserId, Name(antagEnt.Value));
-                _mind.SetUserId(curMind.Value, session.UserId);
-            }
+            var curMind = _mind.CreateMind(session.UserId, Name(antagEnt.Value));
+            _mind.SetUserId(curMind, session.UserId);
+
+            _mind.TransferTo(curMind, antagEnt, ghostCheckOverride: true);
+            _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);
         }