Add test for airlocks opening/closing and blocking entities (#1842)
* Add test for airlocks opening/closing and blocking entities * Nullable fix classic
This commit is contained in:
@@ -144,9 +144,9 @@ namespace Content.Server.GameObjects.Components.Doors
|
||||
}
|
||||
}
|
||||
|
||||
protected override DoorState State
|
||||
public override DoorState State
|
||||
{
|
||||
set
|
||||
protected set
|
||||
{
|
||||
base.State = value;
|
||||
// Only show the maintenance panel if the airlock is closed
|
||||
@@ -171,7 +171,11 @@ namespace Content.Server.GameObjects.Components.Doors
|
||||
|
||||
public override void OnRemove()
|
||||
{
|
||||
_powerReceiver.OnPowerStateChanged -= PowerDeviceOnOnPowerStateChanged;
|
||||
if (Owner.TryGetComponent(out _powerReceiver))
|
||||
{
|
||||
_powerReceiver.OnPowerStateChanged -= PowerDeviceOnOnPowerStateChanged;
|
||||
}
|
||||
|
||||
base.OnRemove();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@ namespace Content.Server.GameObjects.Components.Doors
|
||||
|
||||
private DoorState _state = DoorState.Closed;
|
||||
|
||||
protected virtual DoorState State
|
||||
public virtual DoorState State
|
||||
{
|
||||
get => _state;
|
||||
set => _state = value;
|
||||
protected set => _state = value;
|
||||
}
|
||||
|
||||
protected float OpenTimeCounter;
|
||||
@@ -80,7 +80,7 @@ namespace Content.Server.GameObjects.Components.Doors
|
||||
|
||||
public override void OnRemove()
|
||||
{
|
||||
_cancellationTokenSource.Cancel();
|
||||
_cancellationTokenSource?.Cancel();
|
||||
_collidableComponent = null;
|
||||
_appearance = null;
|
||||
|
||||
@@ -336,7 +336,7 @@ namespace Content.Server.GameObjects.Components.Doors
|
||||
}
|
||||
}
|
||||
|
||||
protected enum DoorState
|
||||
public enum DoorState
|
||||
{
|
||||
Closed,
|
||||
Open,
|
||||
|
||||
Reference in New Issue
Block a user