This commit is contained in:
ShadowCommander
2023-03-26 11:31:13 -07:00
committed by GitHub
parent 0e5dc41fe8
commit bfc4da9377
85 changed files with 1150 additions and 684 deletions

View File

@@ -3,6 +3,7 @@ using Content.Server.EUI;
using Content.Server.Ghost.Components;
using Content.Server.Ghost.Roles.Components;
using Content.Server.Ghost.Roles.UI;
using Content.Server.Mind;
using Content.Server.Mind.Components;
using Content.Server.Players;
using Content.Shared.Administration;
@@ -30,6 +31,7 @@ namespace Content.Server.Ghost.Roles
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly FollowerSystem _followerSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
private uint _nextRoleIdentifier;
private bool _needsUpdateGhostRoleCount = true;
@@ -204,14 +206,12 @@ namespace Content.Server.Ghost.Roles
DebugTools.AssertNotNull(contentData);
var newMind = new Mind.Mind(player.UserId)
{
CharacterName = EntityManager.GetComponent<MetaDataComponent>(mob).EntityName
};
newMind.AddRole(new GhostRoleMarkerRole(newMind, role.RoleName));
var newMind = _mindSystem.CreateMind(player.UserId,
EntityManager.GetComponent<MetaDataComponent>(mob).EntityName);
_mindSystem.AddRole(newMind, new GhostRoleMarkerRole(newMind, role.RoleName));
newMind.ChangeOwningPlayer(player.UserId);
newMind.TransferTo(mob);
_mindSystem.ChangeOwningPlayer(newMind, player.UserId);
_mindSystem.TransferTo(newMind, mob);
}
public GhostRoleInfo[] GetGhostRolesInfo()