* network airlock AutoClose
* least stupid language
* great language
---------
Co-authored-by: deltanedas <@deltanedas:kde.org>
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);
}
}
return;
}
- if (component.KeepOpenIfClicked)
+ if (component.KeepOpenIfClicked && component.AutoClose)
{
// Disable auto close
component.AutoClose = false;
+ Dirty(uid, 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>
// 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)