Content changes for engine RotateEvent removal PR (#11448)

This commit is contained in:
Leon Friedrich
2022-09-23 15:57:30 +12:00
committed by GitHub
parent caa5efcd6f
commit e5f968a7fb
10 changed files with 30 additions and 26 deletions

View File

@@ -19,7 +19,7 @@ namespace Content.Server.Atmos.EntitySystems
SubscribeLocalEvent<AirtightComponent, ComponentShutdown>(OnAirtightShutdown);
SubscribeLocalEvent<AirtightComponent, AnchorStateChangedEvent>(OnAirtightPositionChanged);
SubscribeLocalEvent<AirtightComponent, ReAnchorEvent>(OnAirtightReAnchor);
SubscribeLocalEvent<AirtightComponent, RotateEvent>(OnAirtightRotated);
SubscribeLocalEvent<AirtightComponent, MoveEvent>(OnAirtightRotated);
}
private void OnAirtightInit(EntityUid uid, AirtightComponent airtight, ComponentInit args)
@@ -28,8 +28,8 @@ namespace Content.Server.Atmos.EntitySystems
if (airtight.FixAirBlockedDirectionInitialize)
{
var rotateEvent = new RotateEvent(airtight.Owner, Angle.Zero, xform.LocalRotation, xform);
OnAirtightRotated(uid, airtight, ref rotateEvent);
var moveEvent = new MoveEvent(airtight.Owner, default, default, Angle.Zero, xform.LocalRotation, xform, false);
OnAirtightRotated(uid, airtight, ref moveEvent);
}
// Adding this component will immediately anchor the entity, because the atmos system
@@ -79,13 +79,13 @@ namespace Content.Server.Atmos.EntitySystems
}
}
private void OnAirtightRotated(EntityUid uid, AirtightComponent airtight, ref RotateEvent ev)
private void OnAirtightRotated(EntityUid uid, AirtightComponent airtight, ref MoveEvent ev)
{
if (!airtight.RotateAirBlocked || airtight.InitialAirBlockedDirection == (int)AtmosDirection.Invalid)
return;
airtight.CurrentAirBlockedDirection = (int) Rotate((AtmosDirection)airtight.InitialAirBlockedDirection, ev.NewRotation);
UpdatePosition(airtight);
UpdatePosition(airtight, ev.Component);
RaiseLocalEvent(uid, new AirtightChanged(airtight), true);
}