diff --git a/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs b/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs index f5991e6111..b686503a4d 100644 --- a/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs +++ b/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs @@ -7,6 +7,7 @@ namespace Exiled.Events.EventArgs.Player { + using API.Enums; using API.Features; using Exiled.API.Features.Doors; using Interactables.Interobjects.DoorUtils; @@ -29,11 +30,15 @@ public class InteractingDoorEventArgs : IPlayerEvent, IDoorEvent, IDeniableEvent /// /// /// - public InteractingDoorEventArgs(Player player, DoorVariant door, bool isAllowed = true) + /// + /// + /// + public InteractingDoorEventArgs(Player player, DoorVariant door, bool isAllowed = true, DoorBeepType interactionResult = DoorBeepType.InteractionAllowed) { Player = player; Door = Door.Get(door); IsAllowed = isAllowed; + InteractionResult = interactionResult; } /// @@ -50,5 +55,10 @@ public InteractingDoorEventArgs(Player player, DoorVariant door, bool isAllowed /// Gets the player who's interacting with the door. /// public Player Player { get; } + + /// + /// Gets or sets a value indicating the result of the interaction. + /// + public DoorBeepType InteractionResult { get; set; } } } diff --git a/Exiled.Events/Patches/Events/Player/InteractingDoor.cs b/Exiled.Events/Patches/Events/Player/InteractingDoor.cs index 8ab8d2c0fa..8c73b149af 100644 --- a/Exiled.Events/Patches/Events/Player/InteractingDoor.cs +++ b/Exiled.Events/Patches/Events/Player/InteractingDoor.cs @@ -7,10 +7,17 @@ namespace Exiled.Events.Patches.Events.Player { +#pragma warning disable SA1313 +#pragma warning disable SA1005 +#pragma warning disable SA1515 +#pragma warning disable SA1513 +#pragma warning disable SA1512 + using System; using System.Collections.Generic; using System.Reflection.Emit; using API.Features; + using Exiled.API.Enums; using Exiled.API.Features.Pools; using Exiled.Events.Attributes; using Exiled.Events.EventArgs.Player; @@ -19,6 +26,10 @@ namespace Exiled.Events.Patches.Events.Player using Interactables.Interobjects.DoorUtils; + using PlayerRoles; + + using PluginAPI.Events; + using static HarmonyLib.AccessTools; /// @@ -34,91 +45,127 @@ private static IEnumerable Transpiler(IEnumerable newInstructions = ListPool.Pool.Get(instructions); LocalBuilder ev = generator.DeclareLocal(typeof(InteractingDoorEventArgs)); - - List