parent
52ee1498ec
commit
4407edd5d7
|
|
@ -258,9 +258,6 @@ public sealed partial class DoorComponent : Component
|
|||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool CanPry = true;
|
||||
|
||||
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadOnly)]
|
||||
public bool IsBeingPried;
|
||||
|
||||
[DataField]
|
||||
public ProtoId<ToolQualityPrototype> PryingQuality = "Prying";
|
||||
|
||||
|
|
|
|||
|
|
@ -40,9 +40,10 @@ public abstract class SharedAirlockSystem : EntitySystem
|
|||
// only block based on bolts / power status when initially closing the door, not when its already
|
||||
// mid-transition. Particularly relevant for when the door was pried-closed with a crowbar, which bypasses
|
||||
// the initial power-check.
|
||||
|
||||
if (TryComp(uid, out DoorComponent? door)
|
||||
&& !door.Partial
|
||||
&& !CanChangeState(uid, airlock, door.IsBeingPried))
|
||||
&& !CanChangeState(uid, airlock))
|
||||
{
|
||||
args.Cancel();
|
||||
}
|
||||
|
|
@ -173,8 +174,8 @@ public abstract class SharedAirlockSystem : EntitySystem
|
|||
component.Safety = value;
|
||||
}
|
||||
|
||||
public bool CanChangeState(EntityUid uid, AirlockComponent component, bool isBeingPried = false)
|
||||
public bool CanChangeState(EntityUid uid, AirlockComponent component)
|
||||
{
|
||||
return component.Powered && !DoorSystem.IsBolted(uid) || !component.Powered && isBeingPried ;
|
||||
return component.Powered && !DoorSystem.IsBolted(uid);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,7 +236,6 @@ public abstract partial class SharedDoorSystem : EntitySystem
|
|||
}
|
||||
else if (door.State == DoorState.Open)
|
||||
{
|
||||
door.IsBeingPried = true;
|
||||
_adminLog.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.User)} pried {ToPrettyString(uid)} closed");
|
||||
StartClosing(uid, door, args.User, true);
|
||||
}
|
||||
|
|
@ -478,13 +477,11 @@ public abstract partial class SharedDoorSystem : EntitySystem
|
|||
door.NextStateChange = GameTiming.CurTime + door.OpenTimeTwo;
|
||||
door.State = DoorState.Open;
|
||||
AppearanceSystem.SetData(uid, DoorVisuals.State, DoorState.Open);
|
||||
door.IsBeingPried = false;
|
||||
Dirty(uid, door);
|
||||
return false;
|
||||
}
|
||||
|
||||
door.Partial = true;
|
||||
door.IsBeingPried = false;
|
||||
SetCollidable(uid, true, door, physics);
|
||||
door.NextStateChange = GameTiming.CurTime + door.CloseTimeTwo;
|
||||
Dirty(uid, door);
|
||||
|
|
|
|||
Loading…
Reference in New Issue