From e39deea11e0beb2f10e860a184023ff17791c57d Mon Sep 17 00:00:00 2001 From: DatGuy1 Date: Thu, 4 Feb 2021 08:59:43 +0200 Subject: [PATCH] Fix GameOptionsData modifications not applying (#6) --- Reactor.Debugger/DebuggerPlugin.cs | 4 ++++ Reactor.Debugger/Patches/Test.cs | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Reactor.Debugger/DebuggerPlugin.cs b/Reactor.Debugger/DebuggerPlugin.cs index 11ab8c9..61e2a48 100644 --- a/Reactor.Debugger/DebuggerPlugin.cs +++ b/Reactor.Debugger/DebuggerPlugin.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using BepInEx; using BepInEx.IL2CPP; using HarmonyLib; @@ -27,6 +28,9 @@ namespace Reactor.Debugger var gameObject = new GameObject(nameof(DebuggerPlugin)).DontDestroy(); Component = gameObject.AddComponent(); + GameOptionsData.MaxImpostors = GameOptionsData.RecommendedImpostors = Enumerable.Repeat((int) byte.MaxValue, byte.MaxValue).ToArray(); + GameOptionsData.MinPlayers = Enumerable.Repeat(1, 4).ToArray(); + Harmony.PatchAll(); Extensions.Extensions.once_sceneLoaded((_, _) => diff --git a/Reactor.Debugger/Patches/Test.cs b/Reactor.Debugger/Patches/Test.cs index 3440779..01fc602 100644 --- a/Reactor.Debugger/Patches/Test.cs +++ b/Reactor.Debugger/Patches/Test.cs @@ -1,16 +1,9 @@ -using System.Linq; using HarmonyLib; namespace Reactor.Debugger.Patches { public static class Test { - static Test() - { - GameOptionsData.MaxImpostors = GameOptionsData.RecommendedImpostors = Enumerable.Repeat((int) byte.MaxValue, byte.MaxValue).ToArray(); - GameOptionsData.MinPlayers = Enumerable.Repeat(1, 4).ToArray(); - } - [HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Update))] public static class UpdatePatch {