network airlock AutoClose (#32124)
* network airlock AutoClose * least stupid language * great language --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -35,9 +35,10 @@ public sealed class AirlockSystem : SharedAirlockSystem
|
||||
|
||||
private void OnSignalReceived(EntityUid uid, AirlockComponent component, ref SignalReceivedEvent args)
|
||||
{
|
||||
if (args.Port == component.AutoClosePort)
|
||||
if (args.Port == component.AutoClosePort && component.AutoClose)
|
||||
{
|
||||
component.AutoClose = false;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,10 +85,11 @@ public sealed class AirlockSystem : SharedAirlockSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (component.KeepOpenIfClicked)
|
||||
if (component.KeepOpenIfClicked && component.AutoClose)
|
||||
{
|
||||
// Disable auto close
|
||||
component.AutoClose = false;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public sealed partial class AirlockComponent : Component
|
||||
/// <summary>
|
||||
/// Whether the airlock should auto close. This value is reset every time the airlock closes.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField, AutoNetworkedField]
|
||||
public bool AutoClose = true;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -56,7 +56,10 @@ public abstract class SharedAirlockSystem : EntitySystem
|
||||
|
||||
// Make sure the airlock auto closes again next time it is opened
|
||||
if (args.State == DoorState.Closed)
|
||||
{
|
||||
component.AutoClose = true;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBeforeDoorOpened(EntityUid uid, AirlockComponent component, BeforeDoorOpenedEvent args)
|
||||
|
||||
Reference in New Issue
Block a user