diff --git a/Content.Client/Eye/EyeLerpingSystem.cs b/Content.Client/Eye/EyeLerpingSystem.cs index 78e1b851fc..ac32299dca 100644 --- a/Content.Client/Eye/EyeLerpingSystem.cs +++ b/Content.Client/Eye/EyeLerpingSystem.cs @@ -86,7 +86,7 @@ public sealed class EyeLerpingSystem : EntitySystem private void HandleMapChange(EntityUid uid, LerpingEyeComponent component, ref EntParentChangedMessage args) { // Is this actually a map change? If yes, stop any lerps - if (args.OldMapId != args.Transform.MapID) + if (args.OldMapId != args.Transform.MapUid) component.LastRotation = GetRotation(uid, args.Transform); } diff --git a/Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs b/Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs index 24f0e8a1d3..d00e319eed 100644 --- a/Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs +++ b/Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs @@ -195,7 +195,7 @@ public sealed partial class ReplaySpectatorSystem if (uid != _player.LocalEntity) return; - if (args.Transform.MapUid != null || args.OldMapId == MapId.Nullspace) + if (args.Transform.MapUid != null || args.OldMapId == null) return; if (_spectatorData != null) diff --git a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs index 60d90e1e60..5a9134e3b4 100644 --- a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs @@ -25,16 +25,19 @@ namespace Content.Server.Atmos.EntitySystems private void OnAirtightInit(Entity airtight, ref ComponentInit args) { - var xform = EntityManager.GetComponent(airtight); - - if (airtight.Comp.FixAirBlockedDirectionInitialize) + // TODO AIRTIGHT what FixAirBlockedDirectionInitialize even for? + if (!airtight.Comp.FixAirBlockedDirectionInitialize) { - var moveEvent = new MoveEvent(airtight, default, default, Angle.Zero, xform.LocalRotation, xform, false); - if (AirtightMove(airtight, ref moveEvent)) - return; + UpdatePosition(airtight); + return; } - UpdatePosition(airtight); + var xform = Transform(airtight); + airtight.Comp.CurrentAirBlockedDirection = + (int) Rotate((AtmosDirection) airtight.Comp.InitialAirBlockedDirection, xform.LocalRotation); + UpdatePosition(airtight, xform); + var airtightEv = new AirtightChanged(airtight, airtight, default); + RaiseLocalEvent(airtight, ref airtightEv, true); } private void OnAirtightShutdown(Entity airtight, ref ComponentShutdown args) @@ -42,13 +45,8 @@ namespace Content.Server.Atmos.EntitySystems var xform = Transform(airtight); // If the grid is deleting no point updating atmos. - if (HasComp(xform.GridUid) && - MetaData(xform.GridUid.Value).EntityLifeStage > EntityLifeStage.MapInitialized) - { - return; - } - - SetAirblocked(airtight, false, xform); + if (xform.GridUid != null && LifeStage(xform.GridUid.Value) <= EntityLifeStage.MapInitialized) + SetAirblocked(airtight, false, xform); } private void OnAirtightPositionChanged(EntityUid uid, AirtightComponent airtight, ref AnchorStateChangedEvent args) @@ -83,21 +81,14 @@ namespace Content.Server.Atmos.EntitySystems } } - private void OnAirtightMoved(Entity airtight, ref MoveEvent ev) - { - AirtightMove(airtight, ref ev); - } - - private bool AirtightMove(Entity ent, ref MoveEvent ev) + private void OnAirtightMoved(Entity ent, ref MoveEvent ev) { var (owner, airtight) = ent; - airtight.CurrentAirBlockedDirection = (int) Rotate((AtmosDirection)airtight.InitialAirBlockedDirection, ev.NewRotation); var pos = airtight.LastPosition; UpdatePosition(ent, ev.Component); var airtightEv = new AirtightChanged(owner, airtight, pos); RaiseLocalEvent(owner, ref airtightEv, true); - return true; } public void SetAirblocked(Entity airtight, bool airblocked, TransformComponent? xform = null) diff --git a/Content.Shared/Movement/Systems/SharedMoverController.Input.cs b/Content.Shared/Movement/Systems/SharedMoverController.Input.cs index bce3aeff52..ba175b345f 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.Input.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.Input.cs @@ -259,7 +259,7 @@ namespace Content.Shared.Movement.Systems } var oldMapId = args.OldMapId; - var mapId = args.Transform.MapID; + var mapId = args.Transform.MapUid; // If we change maps then reset eye rotation entirely. if (oldMapId != mapId) diff --git a/Content.Shared/Stealth/SharedStealthSystem.cs b/Content.Shared/Stealth/SharedStealthSystem.cs index d0ea804534..1bab55589f 100644 --- a/Content.Shared/Stealth/SharedStealthSystem.cs +++ b/Content.Shared/Stealth/SharedStealthSystem.cs @@ -113,7 +113,7 @@ public abstract class SharedStealthSystem : EntitySystem private void OnMove(EntityUid uid, StealthOnMoveComponent component, ref MoveEvent args) { - if (args.FromStateHandling) + if (_timing.ApplyingState) return; if (args.NewPosition.EntityId != args.OldPosition.EntityId)