* Converted all SnapGridPositionChangedEvent subscriptions to AnchorStateChangedEvent. * Fixes power tests with new anchored requirements. * Moved AnchorableComponent into construction. AnchorableComponent now uses Transform.Anchored. * Fixed bug with nodes, power works again. * Adds lifetime stages to Component. * Update Engine to v0.4.70.
27 lines
824 B
C#
27 lines
824 B
C#
using Content.Server.Atmos.Components;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.GameObjects;
|
|
|
|
namespace Content.Server.Atmos.EntitySystems
|
|
{
|
|
[UsedImplicitly]
|
|
public class AirtightSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<AirtightComponent, AnchorStateChangedEvent>(OnAirtightPositionChanged);
|
|
SubscribeLocalEvent<AirtightComponent, RotateEvent>(OnAirtightRotated);
|
|
}
|
|
|
|
private void OnAirtightPositionChanged(EntityUid uid, AirtightComponent component, AnchorStateChangedEvent args)
|
|
{
|
|
component.AnchorStateChanged();
|
|
}
|
|
|
|
private void OnAirtightRotated(EntityUid uid, AirtightComponent airtight, RotateEvent ev)
|
|
{
|
|
airtight.RotateEvent(ev);
|
|
}
|
|
}
|
|
}
|