Fix firelock door init (#6384)

This commit is contained in:
Leon Friedrich
2022-01-30 17:47:24 +13:00
committed by GitHub
parent c30e4b36db
commit 1914560773
6 changed files with 22 additions and 25 deletions

View File

@@ -34,15 +34,18 @@ namespace Content.Server.Doors.Systems
appearanceComponent.SetData(DoorVisuals.Powered, args.Powered);
}
if (!TryComp(uid, out DoorComponent? door))
return;
if (!args.Powered)
{
// stop any scheduled auto-closing
DoorSystem.SetNextStateChange(uid, null);
if (door.State == DoorState.Open)
DoorSystem.SetNextStateChange(uid, null);
}
else
{
// door received power. Lets "wake" the door up, in case it is currently open and needs to auto-close.
DoorSystem.SetNextStateChange(uid, TimeSpan.FromSeconds(1));
UpdateAutoClose(uid, door: door);
}
// BoltLights also got out