Content changes for engine exception tolerance PR (#27455)

* Content changes for engine exception tolerance PR

* Poke tests
This commit is contained in:
Leon Friedrich
2024-04-29 20:43:15 +12:00
committed by GitHub
parent 6d619c9420
commit 3c154abb5b
5 changed files with 17 additions and 26 deletions

View 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);
}

View 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)

View 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))
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,12 +45,7 @@ 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;
}
if (xform.GridUid != null && LifeStage(xform.GridUid.Value) <= EntityLifeStage.MapInitialized)
SetAirblocked(airtight, false, xform);
}
@@ -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)

View 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)

View 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)