Skip to content

Commit

Permalink
AntagSelectionFix (SerbiaStrong-220#1531)
Browse files Browse the repository at this point in the history
* fix

* autoformat

* mark 220

* autoformat...

* meh
  • Loading branch information
MiraHell authored Aug 6, 2024
1 parent a996a1e commit 27b6e4e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Content.Server/Antag/AntagSelectionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,19 @@ public void MakeAntag(Entity<AntagSelectionComponent> ent, ICommonSession? sessi

if (session != null)
{
var curMind = _mind.CreateMind(session.UserId, Name(antagEnt.Value));
_mind.SetUserId(curMind, session.UserId);
// start 220 AntagSelectionFix
var curMind = session.GetMind();

_mind.TransferTo(curMind, antagEnt, ghostCheckOverride: true);
_role.MindAddRoles(curMind, def.MindComponents, null, true);
ent.Comp.SelectedMinds.Add((curMind, Name(player)));
if (curMind == null || session.AttachedEntity != 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)));
// end 220 AntagSelectionFix

SendBriefing(session, def.Briefing);
}
Expand Down

0 comments on commit 27b6e4e

Please sign in to comment.