Fix improper prediction on unpryable doors (#24738)
Fix improper prediction on unpryable doors. Entities that had CanPry to false on their components would get improperly predicted as pryable on the client because the check was only preformed on the server. Same problem existed for welded doors. Moved the check from server to shared.
This commit is contained in:
@@ -28,8 +28,6 @@ public sealed class DoorSystem : SharedDoorSystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
SubscribeLocalEvent<DoorComponent, BeforePryEvent>(OnBeforeDoorPry);
|
||||
SubscribeLocalEvent<DoorComponent, WeldableAttemptEvent>(OnWeldAttempt);
|
||||
SubscribeLocalEvent<DoorComponent, WeldableChangedEvent>(OnWeldChanged);
|
||||
SubscribeLocalEvent<DoorComponent, GotEmaggedEvent>(OnEmagged);
|
||||
@@ -124,12 +122,6 @@ public sealed class DoorSystem : SharedDoorSystem
|
||||
else if (component.State == DoorState.Welded)
|
||||
SetState(uid, DoorState.Closed, component);
|
||||
}
|
||||
|
||||
private void OnBeforeDoorPry(EntityUid id, DoorComponent door, ref BeforePryEvent args)
|
||||
{
|
||||
if (door.State == DoorState.Welded || !door.CanPry)
|
||||
args.Cancelled = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user