From 124be9180d450ec0178ee6a7b36273ac1eb6c62d Mon Sep 17 00:00:00 2001 From: MS-crew <100300664+MS-crew@users.noreply.github.com> Date: Mon, 2 Jun 2025 20:40:28 +0300 Subject: [PATCH 1/2] StyleCopAnalyzers Fixes --- .../Patches/Events/Scp914/UpgradingPlayer.cs | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/EXILED/Exiled.Events/Patches/Events/Scp914/UpgradingPlayer.cs b/EXILED/Exiled.Events/Patches/Events/Scp914/UpgradingPlayer.cs index e6a53933a0..3a63607487 100644 --- a/EXILED/Exiled.Events/Patches/Events/Scp914/UpgradingPlayer.cs +++ b/EXILED/Exiled.Events/Patches/Events/Scp914/UpgradingPlayer.cs @@ -114,17 +114,19 @@ private static IEnumerable Transpiler(IEnumerable x.opcode == OpCodes.Stloc_S && x.operand is LocalBuilder { LocalIndex: 10 }) + offset; - ConstructorInfo plugin_api_constructor = typeof(LabApi.Events.Arguments.Scp914Events.Scp914ProcessingInventoryItemEventArgs) - .GetConstructor(new[] { - typeof(InventorySystem.Items.ItemBase), - typeof(Scp914KnobSetting), - typeof(ReferenceHub) - }); + + // index = newInstructions.FindIndex(x => x.opcode == OpCodes.Stloc_S && x.operand is LocalBuilder { LocalIndex: 10 }) + offset; + ConstructorInfo pluginApiConstructor = typeof(LabApi.Events.Arguments.Scp914Events.Scp914ProcessingInventoryItemEventArgs) + .GetConstructor( + new[] + { + typeof(InventorySystem.Items.ItemBase), + typeof(Scp914KnobSetting), + typeof(ReferenceHub), + }); + index = newInstructions.FindIndex(x => x.Is(OpCodes.Newobj, plugin_api_constructor)) + offset; - //ridtp lcz914 - //noclip - //give tuxwonder7 47 + newInstructions.InsertRange( index, new CodeInstruction[] @@ -132,34 +134,34 @@ private static IEnumerable Transpiler(IEnumerable Date: Mon, 2 Jun 2025 20:43:31 +0300 Subject: [PATCH 2/2] Update UpgradingPlayer.cs --- EXILED/Exiled.Events/Patches/Events/Scp914/UpgradingPlayer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXILED/Exiled.Events/Patches/Events/Scp914/UpgradingPlayer.cs b/EXILED/Exiled.Events/Patches/Events/Scp914/UpgradingPlayer.cs index 3a63607487..075c365fa1 100644 --- a/EXILED/Exiled.Events/Patches/Events/Scp914/UpgradingPlayer.cs +++ b/EXILED/Exiled.Events/Patches/Events/Scp914/UpgradingPlayer.cs @@ -125,7 +125,7 @@ private static IEnumerable Transpiler(IEnumerable x.Is(OpCodes.Newobj, plugin_api_constructor)) + offset; + index = newInstructions.FindIndex(x => x.Is(OpCodes.Newobj, pluginApiConstructor)) + offset; newInstructions.InsertRange( index,