logic gate stuff (#16943)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-06-07 23:48:42 +00:00
committed by GitHub
parent d954957a11
commit 07d2430840
29 changed files with 547 additions and 205 deletions

View File

@@ -65,21 +65,21 @@ namespace Content.Server.DeviceLinking.Systems
}
else if (args.Port == component.InBolt)
{
if (state == SignalState.High)
if (!TryComp<DoorBoltComponent>(uid, out var bolts))
return;
// if its a pulse toggle, otherwise set bolts to high/low
bool bolt;
if (state == SignalState.Momentary)
{
if(TryComp<DoorBoltComponent>(uid, out var bolts))
_bolts.SetBoltsWithAudio(uid, bolts, true);
}
else if (state == SignalState.Momentary)
{
if (TryComp<DoorBoltComponent>(uid, out var bolts))
_bolts.SetBoltsWithAudio(uid, bolts, newBolts: !bolts.BoltsDown);
bolt = !bolts.BoltsDown;
}
else
{
if(TryComp<DoorBoltComponent>(uid, out var bolts))
_bolts.SetBoltsWithAudio(uid, bolts, false);
bolt = state == SignalState.High;
}
_bolts.SetBoltsWithAudio(uid, bolts, bolt);
}
}