This commit is contained in:
Leon Friedrich
2022-12-20 20:03:28 +13:00
committed by GitHub
parent 14f8b4e6d5
commit 034c721b5a
2 changed files with 7 additions and 5 deletions

View File

@@ -27,11 +27,11 @@ namespace Content.Server.Mind
/// </remarks> /// </remarks>
public sealed class Mind public sealed class Mind
{ {
[Dependency] private readonly MobStateSystem _mobStateSystem = default!; private readonly MobStateSystem _mobStateSystem = default!;
private readonly GameTicker _gameTickerSystem = default!;
private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly GameTicker _gameTickerSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
private readonly ISet<Role> _roles = new HashSet<Role>(); private readonly ISet<Role> _roles = new HashSet<Role>();
@@ -49,6 +49,9 @@ namespace Content.Server.Mind
{ {
OriginalOwnerUserId = userId; OriginalOwnerUserId = userId;
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_entityManager.EntitySysManager.Resolve(ref _mobStateSystem);
_entityManager.EntitySysManager.Resolve(ref _gameTickerSystem);
_entityManager.EntitySysManager.Resolve(ref _mindSystem);
} }
// TODO: This session should be able to be changed, probably. // TODO: This session should be able to be changed, probably.

View File

@@ -13,7 +13,6 @@ namespace Content.Server.Suspicion
public sealed class SuspicionRoleComponent : SharedSuspicionRoleComponent public sealed class SuspicionRoleComponent : SharedSuspicionRoleComponent
{ {
[Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
private Role? _role; private Role? _role;
[ViewVariables] [ViewVariables]
@@ -54,7 +53,7 @@ namespace Content.Server.Suspicion
public bool IsDead() public bool IsDead()
{ {
return _entMan.TryGetComponent(Owner, out MobStateComponent? state) && return _entMan.TryGetComponent(Owner, out MobStateComponent? state) &&
_mobStateSystem.IsDead(Owner, state); _entMan.EntitySysManager.GetEntitySystem<MobStateSystem>().IsDead(Owner, state);
} }
public bool IsInnocent() public bool IsInnocent()