]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Content changes for engine exception tolerance PR (#27455)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Mon, 29 Apr 2024 08:43:15 +0000 (20:43 +1200)
committerGitHub <noreply@github.com>
Mon, 29 Apr 2024 08:43:15 +0000 (18:43 +1000)
* Content changes for engine exception tolerance PR

* Poke tests

Content.Client/Eye/EyeLerpingSystem.cs
Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs
Content.Server/Atmos/EntitySystems/AirtightSystem.cs
Content.Shared/Movement/Systems/SharedMoverController.Input.cs
Content.Shared/Stealth/SharedStealthSystem.cs

index 78e1b851fcbda8868a47b9181dfdee4c5e639819..ac32299dca7dc7aa2312e25ee07f8f92c7b45b35 100644 (file)
@@ -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);
     }
 
index 24f0e8a1d34035bd777889f6c3abe7fa719f4640..d00e319eed91c3fba223f7b662ee404323337706 100644 (file)
@@ -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)
index 60d90e1e609456caf423862c4c7c3cd39d52d99e..5a9134e3b4db40786a0f5802b373cc4e22ee936c 100644 (file)
@@ -25,16 +25,19 @@ namespace Content.Server.Atmos.EntitySystems
 
         private void OnAirtightInit(Entity<AirtightComponent> airtight, ref ComponentInit args)
         {
-            var xform = EntityManager.GetComponent<TransformComponent>(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<AirtightComponent> 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<MapGridComponent>(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<AirtightComponent> airtight, ref MoveEvent ev)
-        {
-            AirtightMove(airtight, ref ev);
-        }
-
-        private bool AirtightMove(Entity<AirtightComponent> ent, ref MoveEvent ev)
+        private void OnAirtightMoved(Entity<AirtightComponent> 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<AirtightComponent> airtight, bool airblocked, TransformComponent? xform = null)
index bce3aeff5271dfd7aa22470ad82539a1ac60eb9e..ba175b345f8cfd9a55ed5d2cc7dabe03f85322c8 100644 (file)
@@ -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)
index d0ea8045347f900ae1464e60b3de0a56fc510941..1bab55589fd2f6245749931e6491bbe2a91b1ce7 100644 (file)
@@ -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)