From 79fd99353a3eb843144e5afa17cc3593e3feb25c Mon Sep 17 00:00:00 2001 From: Bolton <48883340+BoltonDev@users.noreply.github.com> Date: Sun, 24 Mar 2024 13:21:56 +0100 Subject: [PATCH] `[Exiled::Events]` (`Bug fix`) Scp173Gate can't be closed when using InteractingDoor event `[Exiled::API]` (`Bug fix`) Fix Scp173Gate IsFullyOpen always return false (#2492) * fix: InteractingDoorPatch * fix: IsFullyOpen 173Gate * fix --- Exiled.API/Features/Doors/Door.cs | 2 +- Exiled.API/Features/Doors/Gate.cs | 2 +- Exiled.Events/Patches/Events/Player/InteractingDoor.cs | 9 --------- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Exiled.API/Features/Doors/Door.cs b/Exiled.API/Features/Doors/Door.cs index 00501e9c10..35037d3672 100644 --- a/Exiled.API/Features/Doors/Door.cs +++ b/Exiled.API/Features/Doors/Door.cs @@ -111,7 +111,7 @@ internal Door(DoorVariant door, List rooms) /// /// Gets a value indicating whether or not the door is currently moving. /// - public virtual bool IsMoving => ExactState is not(0 or 1); + public virtual bool IsMoving => !(IsFullyOpen || IsFullyClosed); /// /// Gets a value indicating the precise state of the door, from 0-1. A value of 0 indicates the door is fully closed, while a value of 1 indicates the door is fully open. Values in-between represent the door's animation progress. diff --git a/Exiled.API/Features/Doors/Gate.cs b/Exiled.API/Features/Doors/Gate.cs index 43d42e03d8..20679cf582 100644 --- a/Exiled.API/Features/Doors/Gate.cs +++ b/Exiled.API/Features/Doors/Gate.cs @@ -48,7 +48,7 @@ public Gate(PryableDoor door, List room) /// /// Gets a value indicating whether the door is fully open. /// - public override bool IsFullyOpen => base.IsFullyOpen; + public override bool IsFullyOpen => base.IsFullyOpen || (Base is Timed173PryableDoor && ExactState is 0.5845918f); /// /// Gets a value indicating whether or not the door is currently moving. diff --git a/Exiled.Events/Patches/Events/Player/InteractingDoor.cs b/Exiled.Events/Patches/Events/Player/InteractingDoor.cs index 6f491b8118..f77fd04126 100644 --- a/Exiled.Events/Patches/Events/Player/InteractingDoor.cs +++ b/Exiled.Events/Patches/Events/Player/InteractingDoor.cs @@ -44,10 +44,6 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable.Pool.Return(newInstructions); } - - private static bool CanStateChange(DoorVariant variant) - { - return !(variant.GetExactState() > 0f && variant.GetExactState() < 1f); - } } } \ No newline at end of file