Skip to content

Commit 55b9ddb

Browse files
committed
[F] fix init
1 parent 11a2854 commit 55b9ddb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

AquaMai.Mods/GameSystem/MaimollerIO/MaimollerIO.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,13 @@ public class MaimollerIO
116116
zh: "当混用 Maimoller 与其他协议并且 Maimoller 在 2P 上,而且 Maimoller 无法正常使用时开启")]
117117
private static readonly bool alternative2p = false;
118118

119-
private static readonly MaimollerDevice[] _devices = [.. Enumerable.Range(0, 2).Select(i => new MaimollerDevice(i, alternative2p))];
120-
private static readonly MaimollerLedManager[] _ledManagers = [.. Enumerable.Range(0, 2).Select(i => new MaimollerLedManager(_devices[i].output))];
119+
private static MaimollerDevice[] _devices;
120+
private static MaimollerLedManager[] _ledManagers;
121121

122122
public static void OnBeforePatch()
123123
{
124+
_devices = [.. Enumerable.Range(0, 2).Select(i => new MaimollerDevice(i, alternative2p))];
125+
_ledManagers = [.. Enumerable.Range(0, 2).Select(i => new MaimollerLedManager(_devices[i].output))];
124126
for (int i = 0; i < 2; i++)
125127
{
126128
if (!ShouldInitForPlayer(i)) continue;

0 commit comments

Comments
 (0)