Skip to content

Commit 3c154ab

Browse files
authored
Content changes for engine exception tolerance PR (#27455)
* Content changes for engine exception tolerance PR * Poke tests
1 parent 6d619c9 commit 3c154ab

5 files changed

Lines changed: 17 additions & 26 deletions

File tree

Content.Client/Eye/EyeLerpingSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void RemoveEye(EntityUid uid)
8686
private void HandleMapChange(EntityUid uid, LerpingEyeComponent component, ref EntParentChangedMessage args)
8787
{
8888
// Is this actually a map change? If yes, stop any lerps
89-
if (args.OldMapId != args.Transform.MapID)
89+
if (args.OldMapId != args.Transform.MapUid)
9090
component.LastRotation = GetRotation(uid, args.Transform);
9191
}
9292

Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private void OnParentChanged(EntityUid uid, ReplaySpectatorComponent component,
195195
if (uid != _player.LocalEntity)
196196
return;
197197

198-
if (args.Transform.MapUid != null || args.OldMapId == MapId.Nullspace)
198+
if (args.Transform.MapUid != null || args.OldMapId == null)
199199
return;
200200

201201
if (_spectatorData != null)

Content.Server/Atmos/EntitySystems/AirtightSystem.cs

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,28 @@ public override void Initialize()
2525

2626
private void OnAirtightInit(Entity<AirtightComponent> airtight, ref ComponentInit args)
2727
{
28-
var xform = EntityManager.GetComponent<TransformComponent>(airtight);
29-
30-
if (airtight.Comp.FixAirBlockedDirectionInitialize)
28+
// TODO AIRTIGHT what FixAirBlockedDirectionInitialize even for?
29+
if (!airtight.Comp.FixAirBlockedDirectionInitialize)
3130
{
32-
var moveEvent = new MoveEvent(airtight, default, default, Angle.Zero, xform.LocalRotation, xform, false);
33-
if (AirtightMove(airtight, ref moveEvent))
34-
return;
31+
UpdatePosition(airtight);
32+
return;
3533
}
3634

37-
UpdatePosition(airtight);
35+
var xform = Transform(airtight);
36+
airtight.Comp.CurrentAirBlockedDirection =
37+
(int) Rotate((AtmosDirection) airtight.Comp.InitialAirBlockedDirection, xform.LocalRotation);
38+
UpdatePosition(airtight, xform);
39+
var airtightEv = new AirtightChanged(airtight, airtight, default);
40+
RaiseLocalEvent(airtight, ref airtightEv, true);
3841
}
3942

4043
private void OnAirtightShutdown(Entity<AirtightComponent> airtight, ref ComponentShutdown args)
4144
{
4245
var xform = Transform(airtight);
4346

4447
// If the grid is deleting no point updating atmos.
45-
if (HasComp<MapGridComponent>(xform.GridUid) &&
46-
MetaData(xform.GridUid.Value).EntityLifeStage > EntityLifeStage.MapInitialized)
47-
{
48-
return;
49-
}
50-
51-
SetAirblocked(airtight, false, xform);
48+
if (xform.GridUid != null && LifeStage(xform.GridUid.Value) <= EntityLifeStage.MapInitialized)
49+
SetAirblocked(airtight, false, xform);
5250
}
5351

5452
private void OnAirtightPositionChanged(EntityUid uid, AirtightComponent airtight, ref AnchorStateChangedEvent args)
@@ -83,21 +81,14 @@ private void OnAirtightReAnchor(EntityUid uid, AirtightComponent airtight, ref R
8381
}
8482
}
8583

86-
private void OnAirtightMoved(Entity<AirtightComponent> airtight, ref MoveEvent ev)
87-
{
88-
AirtightMove(airtight, ref ev);
89-
}
90-
91-
private bool AirtightMove(Entity<AirtightComponent> ent, ref MoveEvent ev)
84+
private void OnAirtightMoved(Entity<AirtightComponent> ent, ref MoveEvent ev)
9285
{
9386
var (owner, airtight) = ent;
94-
9587
airtight.CurrentAirBlockedDirection = (int) Rotate((AtmosDirection)airtight.InitialAirBlockedDirection, ev.NewRotation);
9688
var pos = airtight.LastPosition;
9789
UpdatePosition(ent, ev.Component);
9890
var airtightEv = new AirtightChanged(owner, airtight, pos);
9991
RaiseLocalEvent(owner, ref airtightEv, true);
100-
return true;
10192
}
10293

10394
public void SetAirblocked(Entity<AirtightComponent> airtight, bool airblocked, TransformComponent? xform = null)

Content.Shared/Movement/Systems/SharedMoverController.Input.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ private void OnInputParentChange(EntityUid uid, InputMoverComponent component, r
259259
}
260260

261261
var oldMapId = args.OldMapId;
262-
var mapId = args.Transform.MapID;
262+
var mapId = args.Transform.MapUid;
263263

264264
// If we change maps then reset eye rotation entirely.
265265
if (oldMapId != mapId)

Content.Shared/Stealth/SharedStealthSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private void OnStealthHandleState(EntityUid uid, StealthComponent component, ref
113113

114114
private void OnMove(EntityUid uid, StealthOnMoveComponent component, ref MoveEvent args)
115115
{
116-
if (args.FromStateHandling)
116+
if (_timing.ApplyingState)
117117
return;
118118

119119
if (args.NewPosition.EntityId != args.OldPosition.EntityId)

0 commit comments

Comments
 (0)