diff --git a/EXILED/Exiled.Events/Patches/Events/Map/SpawningRoomConnector.cs b/EXILED/Exiled.Events/Patches/Events/Map/SpawningRoomConnector.cs index 4af8bd4e1..4d6a72a8f 100644 --- a/EXILED/Exiled.Events/Patches/Events/Map/SpawningRoomConnector.cs +++ b/EXILED/Exiled.Events/Patches/Events/Map/SpawningRoomConnector.cs @@ -12,10 +12,8 @@ namespace Exiled.Events.Patches.Events.Map #pragma warning disable SA1402 // File may only contain a single type using System.Collections.Generic; - using System.Reflection; using System.Reflection.Emit; - using Exiled.API.Features; using Exiled.API.Features.Pools; using Exiled.Events.Attributes; using Exiled.Events.EventArgs.Map; @@ -87,15 +85,32 @@ internal static class SpawningRoomConnectorFix private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) { List newInstructions = ListPool.Pool.Get(instructions); + Label skip = generator.DefineLabel(); + // steal the code to put it later in the code: + // RoomConnectorSpawnpointBase.SetupAllRoomConnectors(); + // ServerEvents.OnMapGenerated(new MapGeneratedEventArgs(SeedSynchronizer.Seed)); + const int lengthOfCodeToMove = 4; int index = newInstructions.FindIndex(i => i.Calls(Method(typeof(RoomConnectorSpawnpointBase), nameof(RoomConnectorSpawnpointBase.SetupAllRoomConnectors)))); List