AtmosphereSystem subscribes to RotateEvent instead of AirtightComponent.

Fixes a crime against humanity
This commit is contained in:
Víctor Aguilera Puerto
2020-10-20 12:21:13 +02:00
parent 90b7239dcb
commit b409901806
2 changed files with 21 additions and 3 deletions

View File

@@ -88,15 +88,13 @@ namespace Content.Server.GameObjects.Components.Atmos
if (!Owner.EnsureComponent(out SnapGridComponent _))
Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} didn't have a {nameof(SnapGridComponent)}");
Owner.EntityManager.EventBus.SubscribeEvent<RotateEvent>(EventSource.Local, this, RotateEvent);
if(_fixAirBlockedDirectionInitialize)
RotateEvent(new RotateEvent(Owner, Angle.Zero, Owner.Transform.LocalRotation));
UpdatePosition();
}
private void RotateEvent(RotateEvent ev)
public void RotateEvent(RotateEvent ev)
{
if (!_rotateAirBlocked || ev.Sender != Owner || _initialAirBlockedDirection == (int)AtmosDirection.Invalid)
return;