Predict doors and airlocks (#25419)

* predict doors and airlocks

* prying, too

* ack

* eek
This commit is contained in:
Nemanja
2024-02-22 18:01:31 -05:00
committed by GitHub
parent b7747596f1
commit ce0a51fc29
25 changed files with 444 additions and 559 deletions

View File

@@ -19,24 +19,24 @@ public sealed partial class DoorBoltWireAction : ComponentWireAction<DoorBoltCom
public override bool Cut(EntityUid user, Wire wire, DoorBoltComponent airlock)
{
EntityManager.System<DoorBoltSystem>().SetBoltWireCut(airlock, true);
EntityManager.System<DoorSystem>().SetBoltWireCut((wire.Owner, airlock), true);
if (!airlock.BoltsDown && IsPowered(wire.Owner))
EntityManager.System<DoorBoltSystem>().SetBoltsWithAudio(wire.Owner, airlock, true);
EntityManager.System<DoorSystem>().SetBoltsDown((wire.Owner, airlock), true, user);
return true;
}
public override bool Mend(EntityUid user, Wire wire, DoorBoltComponent door)
{
EntityManager.System<DoorBoltSystem>().SetBoltWireCut(door, false);
EntityManager.System<DoorSystem>().SetBoltWireCut((wire.Owner, door), false);
return true;
}
public override void Pulse(EntityUid user, Wire wire, DoorBoltComponent door)
{
if (IsPowered(wire.Owner))
EntityManager.System<DoorBoltSystem>().SetBoltsWithAudio(wire.Owner, door, !door.BoltsDown);
EntityManager.System<DoorSystem>().SetBoltsDown((wire.Owner, door), !door.BoltsDown);
else if (!door.BoltsDown)
EntityManager.System<DoorBoltSystem>().SetBoltsWithAudio(wire.Owner, door, true);
EntityManager.System<DoorSystem>().SetBoltsDown((wire.Owner, door), true);
}
}