Predict doors and airlocks (#25419)
* predict doors and airlocks * prying, too * ack * eek
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user