Fix eye rotation on suicide command (#12985)
This commit is contained in:
@@ -17,8 +17,6 @@ namespace Content.Server.GameTicking
|
|||||||
{
|
{
|
||||||
public const float PresetFailedCooldownIncrease = 30f;
|
public const float PresetFailedCooldownIncrease = 30f;
|
||||||
|
|
||||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
|
||||||
|
|
||||||
public GamePresetPrototype? Preset { get; private set; }
|
public GamePresetPrototype? Preset { get; private set; }
|
||||||
|
|
||||||
private bool StartPreset(IPlayerSession[] origReadyPlayers, bool force)
|
private bool StartPreset(IPlayerSession[] origReadyPlayers, bool force)
|
||||||
@@ -171,8 +169,7 @@ namespace Content.Server.GameTicking
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entities = IoCManager.Resolve<IEntityManager>();
|
if (HasComp<GhostComponent>(playerEntity))
|
||||||
if (entities.HasComponent<GhostComponent>(playerEntity))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (mind.VisitingEntity != default)
|
if (mind.VisitingEntity != default)
|
||||||
@@ -196,7 +193,7 @@ namespace Content.Server.GameTicking
|
|||||||
|
|
||||||
if (canReturnGlobal && TryComp(playerEntity, out MobStateComponent? mobState))
|
if (canReturnGlobal && TryComp(playerEntity, out MobStateComponent? mobState))
|
||||||
{
|
{
|
||||||
if (_mobStateSystem.IsCritical(playerEntity.Value, mobState))
|
if (_mobState.IsCritical(playerEntity.Value, mobState))
|
||||||
{
|
{
|
||||||
canReturn = true;
|
canReturn = true;
|
||||||
|
|
||||||
@@ -207,7 +204,10 @@ namespace Content.Server.GameTicking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var ghost = Spawn("MobObserver", position.ToMap(entities));
|
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||||
|
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.
|
// 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".
|
// If all else fails, it'll default to the default entity prototype name, "observer".
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using Content.Server.Station.Systems;
|
|||||||
using Content.Shared.Chat;
|
using Content.Shared.Chat;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.GameTicking;
|
using Content.Shared.GameTicking;
|
||||||
|
using Content.Shared.MobState.EntitySystems;
|
||||||
using Content.Shared.Roles;
|
using Content.Shared.Roles;
|
||||||
using Robust.Server;
|
using Robust.Server;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
@@ -34,6 +35,8 @@ namespace Content.Server.GameTicking
|
|||||||
public sealed partial class GameTicker : SharedGameTicker
|
public sealed partial class GameTicker : SharedGameTicker
|
||||||
{
|
{
|
||||||
[Dependency] private readonly MapLoaderSystem _map = default!;
|
[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 _initialized;
|
||||||
[ViewVariables] private bool _postInitialized;
|
[ViewVariables] private bool _postInitialized;
|
||||||
|
|||||||
Reference in New Issue
Block a user