diff --git a/EXILED/Exiled.Events/Patches/Events/Scp559/SpawningFlamingos.cs b/EXILED/Exiled.Events/Patches/Events/Scp1507/SpawningFlamingos.cs similarity index 95% rename from EXILED/Exiled.Events/Patches/Events/Scp559/SpawningFlamingos.cs rename to EXILED/Exiled.Events/Patches/Events/Scp1507/SpawningFlamingos.cs index dbdc483ab..cc1d524b8 100644 --- a/EXILED/Exiled.Events/Patches/Events/Scp559/SpawningFlamingos.cs +++ b/EXILED/Exiled.Events/Patches/Events/Scp1507/SpawningFlamingos.cs @@ -32,13 +32,12 @@ private static IEnumerable Transpiler(IEnumerable newInstructions = ListPool.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, @@ -72,7 +71,7 @@ private static IEnumerable Transpiler(IEnumerable 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); @@ -86,6 +85,8 @@ private static IEnumerable Transpiler(IEnumerable