@@ -14,17 +14,13 @@ namespace Exiled.Events.Patches.Events.Item
1414 using API . Features . Pickups ;
1515 using API . Features . Pools ;
1616 using Attributes ;
17- using Exiled . Events ;
1817 using Exiled . Events . EventArgs . Item ;
1918
2019 using Footprinting ;
2120
2221 using HarmonyLib ;
2322
2423 using Interactables . Interobjects . DoorUtils ;
25-
26- using InventorySystem . Items ;
27-
2824 using UnityEngine ;
2925
3026 using static HarmonyLib . AccessTools ;
@@ -35,6 +31,7 @@ namespace Exiled.Events.Patches.Events.Item
3531 /// Patches <see cref="BaseKeycardPickup.ProcessCollision(Collision)"/> and adds <see cref="KeycardPickup.Permissions"/> implementation.
3632 /// Adds the <see cref="Handlers.Player.InteractingDoor"/> event.
3733 /// </summary>
34+ [ EventPatch ( typeof ( Handlers . Item ) , nameof ( Handlers . Item . KeycardInteracting ) ) ]
3835 [ HarmonyPatch ( typeof ( BaseKeycardPickup ) , nameof ( BaseKeycardPickup . ProcessCollision ) ) ]
3936 internal static class KeycardInteracting
4037 {
@@ -90,14 +87,10 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
9087 // door
9188 new ( OpCodes . Ldloc_1 ) ,
9289
93- // isAllowed = isUnlocked && hasPermission && Events.Instance.Config.CanKeycardThrowAffectDoors
90+ // isAllowed = isUnlocked && hasPermission
9491 new ( OpCodes . Ldloc_S , isUnlocked . LocalIndex ) ,
9592 new ( OpCodes . Ldloc_S , hasPermission . LocalIndex ) ,
9693 new ( OpCodes . And ) ,
97- new ( OpCodes . Call , PropertyGetter ( typeof ( Events ) , nameof ( Events . Instance ) ) ) ,
98- new ( OpCodes . Callvirt , PropertyGetter ( typeof ( Events ) , nameof ( Events . Config ) ) ) ,
99- new ( OpCodes . Callvirt , PropertyGetter ( typeof ( Config ) , nameof ( Config . CanKeycardThrowAffectDoors ) ) ) ,
100- new ( OpCodes . And ) ,
10194
10295 // ev = new KeycardInteractingEventArgs(pickup, player, door, isAllowed)
10396 new ( OpCodes . Newobj , GetDeclaredConstructors ( typeof ( KeycardInteractingEventArgs ) ) [ 0 ] ) ,
0 commit comments