Skip to content

Commit 359d0ca

Browse files
committed
fix ConsolePatch
1 parent 1bcbd93 commit 359d0ca

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

Axwabo.CommandSystem/Patches/ConsolePatch.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,29 @@ namespace Axwabo.CommandSystem.Patches;
1010
internal static class ConsolePatch
1111
{
1212

13-
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
13+
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
1414
{
1515
var list = new List<CodeInstruction>(instructions);
16+
var array = generator.Local<string[]>();
1617
var setSender = list.FindCall("get_Sender") + 1;
1718

1819
list.InsertRange(setSender, [
1920
Duplicate,
2021
Stfld(typeof(PlayerSelectionManager), nameof(CurrentSender))
2122
]);
2223

24+
var split = list.FindCall(nameof(string.Split));
25+
list.InsertRange(split + 2, [
26+
Duplicate,
27+
array.Set()
28+
]);
29+
2330
var failedIndex = list.FindIndex(i => i.operand is CommandExecutionFailedError);
2431
var failEnd = list.FindCode(OpCodes.Stloc_S, start: failedIndex);
2532
list.RemoveRange(failedIndex, failEnd - failedIndex);
2633
list.InsertRange(failedIndex, [
2734
Ldarg(2),
28-
Ldloc(1),
35+
array.Load(),
2936
Ldloc(13),
3037
Call<DeveloperMode>(nameof(DeveloperMode.OnExceptionThrown)),
3138
Ldloc(13),

Axwabo.CommandSystem/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
// You can specify all the values or you can default the Build and Revision Numbers
3131
// by using the '*' as shown below:
3232
// [assembly: AssemblyVersion("1.0.*")]
33-
[assembly: AssemblyVersion("1.0.3.0")]
34-
[assembly: AssemblyFileVersion("1.0.3.0")]
33+
[assembly: AssemblyVersion("1.0.4.0")]
34+
[assembly: AssemblyFileVersion("1.0.4.0")]

0 commit comments

Comments
 (0)