diff --git a/Content.Server/GameTicking/GameTicker.GamePreset.cs b/Content.Server/GameTicking/GameTicker.GamePreset.cs index c070585296..3fdb165112 100644 --- a/Content.Server/GameTicking/GameTicker.GamePreset.cs +++ b/Content.Server/GameTicking/GameTicker.GamePreset.cs @@ -17,8 +17,6 @@ namespace Content.Server.GameTicking { public const float PresetFailedCooldownIncrease = 30f; - [Dependency] private readonly MobStateSystem _mobStateSystem = default!; - public GamePresetPrototype? Preset { get; private set; } private bool StartPreset(IPlayerSession[] origReadyPlayers, bool force) @@ -171,8 +169,7 @@ namespace Content.Server.GameTicking return false; } - var entities = IoCManager.Resolve(); - if (entities.HasComponent(playerEntity)) + if (HasComp(playerEntity)) return false; if (mind.VisitingEntity != default) @@ -196,7 +193,7 @@ namespace Content.Server.GameTicking if (canReturnGlobal && TryComp(playerEntity, out MobStateComponent? mobState)) { - if (_mobStateSystem.IsCritical(playerEntity.Value, mobState)) + if (_mobState.IsCritical(playerEntity.Value, mobState)) { canReturn = true; @@ -207,7 +204,10 @@ namespace Content.Server.GameTicking } } - var ghost = Spawn("MobObserver", position.ToMap(entities)); + var xformQuery = GetEntityQuery(); + var coords = _transform.GetMoverCoordinates(position, xformQuery); + + var ghost = Spawn("MobObserver", coords); // Try setting the ghost entity name to either the character name or the player name. // If all else fails, it'll default to the default entity prototype name, "observer". diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 89e2d3c504..ed2c0f3665 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -13,6 +13,7 @@ using Content.Server.Station.Systems; using Content.Shared.Chat; using Content.Shared.Damage; using Content.Shared.GameTicking; +using Content.Shared.MobState.EntitySystems; using Content.Shared.Roles; using Robust.Server; using Robust.Server.GameObjects; @@ -34,6 +35,8 @@ namespace Content.Server.GameTicking public sealed partial class GameTicker : SharedGameTicker { [Dependency] private readonly MapLoaderSystem _map = default!; + [Dependency] private readonly SharedMobStateSystem _mobState = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; [ViewVariables] private bool _initialized; [ViewVariables] private bool _postInitialized;