Skip to content

Commit

Permalink
flamingo event to right namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
IRacle1 committed Dec 26, 2024
1 parent b0e2aa8 commit 26d09d4
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
{
List<CodeInstruction> newInstructions = ListPool<CodeInstruction>.Pool.Get(instructions);

int index = newInstructions.FindIndex(x => x.opcode == OpCodes.Ldc_I4_4);

Label retLabel = generator.DefineLabel();

LocalBuilder ev = generator.DeclareLocal(typeof(SpawningFlamingosEventArgs));

newInstructions[newInstructions.Count - 1].labels.Add(retLabel);
int offset = 0;
int index = newInstructions.FindIndex(x => x.opcode == OpCodes.Ldc_I4_4) + offset;

newInstructions.InsertRange(
index,
Expand Down Expand Up @@ -72,7 +71,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
new(OpCodes.Stsfld, Field(typeof(Scp1507Spawner), nameof(Scp1507Spawner._alpha))),
});

index = newInstructions.FindIndex(x => x.Is(OpCodes.Call, PropertyGetter(typeof(ReferenceHub), nameof(ReferenceHub.AllHubs))));
index = newInstructions.FindIndex(x => x.Calls(PropertyGetter(typeof(ReferenceHub), nameof(ReferenceHub.AllHubs))));

newInstructions.RemoveAt(index);

Expand All @@ -86,6 +85,8 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
new(OpCodes.Call, Method(typeof(SpawningFlamingos), nameof(ReturnEnumerator))),
});

newInstructions[newInstructions.Count - 1].labels.Add(retLabel);

for (int z = 0; z < newInstructions.Count; z++)
yield return newInstructions[z];

Expand Down

0 comments on commit 26d09d4

Please sign in to comment.