Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ namespace Exiled.Events.Patches.Events.Scp914
using Exiled.API.Features.Pools;
using Exiled.Events.Attributes;
using Exiled.Events.EventArgs.Scp914;

using global::Scp914;

using HarmonyLib;

using static HarmonyLib.AccessTools;
Expand All @@ -39,8 +37,8 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi

Label ret = generator.DefineLabel();

int offset = 1;
int index = newInstructions.FindLastIndex(i => i.opcode == OpCodes.Stloc_1) + offset;
int offset = -3;
int index = newInstructions.FindLastIndex(i => i.OperandIs(GetDeclaredConstructors(typeof(LabApi.Events.Arguments.Scp914Events.Scp914KnobChangingEventArgs))[0])) + offset;

newInstructions.InsertRange(index, new[]
{
Expand Down Expand Up @@ -75,7 +73,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
});

offset = -3;
index = newInstructions.FindLastIndex(i => i.opcode == OpCodes.Newobj) + offset;
index = newInstructions.FindLastIndex(i => i.OperandIs(GetDeclaredConstructors(typeof(LabApi.Events.Arguments.Scp914Events.Scp914ActivatingEventArgs))[0])) + offset;

newInstructions.InsertRange(index, new[]
{
Expand Down
Loading