Wires patches (#7993)
* door bolts now set if power is off and wire is pulsed, makes WiresSystem get a new random every time the round restarts * ??? what's shuffle doing in the interface ??? * oops
This commit is contained in:
@@ -55,11 +55,18 @@ public class DoorBoltWireAction : BaseWireAction
|
|||||||
|
|
||||||
public override bool Pulse(EntityUid user, Wire wire)
|
public override bool Pulse(EntityUid user, Wire wire)
|
||||||
{
|
{
|
||||||
if (IsPowered(wire.Owner)
|
if (EntityManager.TryGetComponent<AirlockComponent>(wire.Owner, out var door))
|
||||||
&& EntityManager.TryGetComponent<AirlockComponent>(wire.Owner, out var door))
|
{
|
||||||
|
if (IsPowered(wire.Owner))
|
||||||
{
|
{
|
||||||
door.SetBoltsWithAudio(!door.BoltsDown);
|
door.SetBoltsWithAudio(!door.BoltsDown);
|
||||||
}
|
}
|
||||||
|
else if (!door.BoltsDown)
|
||||||
|
{
|
||||||
|
door.SetBoltsWithAudio(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ namespace Content.Server.Wires;
|
|||||||
|
|
||||||
public sealed class WiresSystem : EntitySystem
|
public sealed class WiresSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
|
||||||
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
||||||
[Dependency] private readonly AudioSystem _audioSystem = default!;
|
[Dependency] private readonly AudioSystem _audioSystem = default!;
|
||||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||||
@@ -33,6 +32,8 @@ public sealed class WiresSystem : EntitySystem
|
|||||||
[Dependency] private readonly HandsSystem _handsSystem = default!;
|
[Dependency] private readonly HandsSystem _handsSystem = default!;
|
||||||
[Dependency] private readonly DoAfterSystem _doAfter = default!;
|
[Dependency] private readonly DoAfterSystem _doAfter = default!;
|
||||||
|
|
||||||
|
private IRobustRandom _random = new RobustRandom();
|
||||||
|
|
||||||
// This is where all the wire layouts are stored.
|
// This is where all the wire layouts are stored.
|
||||||
[ViewVariables] private readonly Dictionary<string, WireLayout> _layouts = new();
|
[ViewVariables] private readonly Dictionary<string, WireLayout> _layouts = new();
|
||||||
|
|
||||||
@@ -824,6 +825,7 @@ public sealed class WiresSystem : EntitySystem
|
|||||||
private void Reset(RoundRestartCleanupEvent args)
|
private void Reset(RoundRestartCleanupEvent args)
|
||||||
{
|
{
|
||||||
_layouts.Clear();
|
_layouts.Clear();
|
||||||
|
_random = new RobustRandom();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user