From a5a10e60cbd02450cc695e4ea2a2db0fcbf1b86d Mon Sep 17 00:00:00 2001 From: yangzhi Date: Tue, 11 Jul 2023 08:06:06 +0800 Subject: [PATCH] Minor fix --- src/SMAPI/Patches/SaveGamePatch.cs | 4 ++-- src/SMAPI/Utilities/Keybind.cs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SMAPI/Patches/SaveGamePatch.cs b/src/SMAPI/Patches/SaveGamePatch.cs index 92718ee4..e3d0da3f 100644 --- a/src/SMAPI/Patches/SaveGamePatch.cs +++ b/src/SMAPI/Patches/SaveGamePatch.cs @@ -201,9 +201,9 @@ namespace StardewModdingAPI.Patches newInsns.Add(insn); Label continueLabel = gen.DefineLabel(); Label retLabel = gen.DefineLabel(); - newInsns.Add(new CodeInstruction(OpCodes.Ldarg_0)); + newInsns.Add(new CodeInstruction(OpCodes.Ldarg_1)); newInsns.Add(new CodeInstruction(OpCodes.Brfalse_S, retLabel)); - newInsns.Add(new CodeInstruction(OpCodes.Ldarg_0)); + newInsns.Add(new CodeInstruction(OpCodes.Ldarg_1)); newInsns.Add(new CodeInstruction(OpCodes.Call, AccessTools.PropertyGetter(typeof(string), nameof(string.Length)))); newInsns.Add(new CodeInstruction(OpCodes.Ldc_I4_0)); newInsns.Add(new CodeInstruction(OpCodes.Cgt)); diff --git a/src/SMAPI/Utilities/Keybind.cs b/src/SMAPI/Utilities/Keybind.cs index 2622f376..f33f086d 100644 --- a/src/SMAPI/Utilities/Keybind.cs +++ b/src/SMAPI/Utilities/Keybind.cs @@ -56,6 +56,8 @@ namespace StardewModdingAPI.Utilities // parse buttons #if SMAPI_FOR_MOBILE string[] rawButtons = input.Split('+', StringSplitOptions.RemoveEmptyEntries); + for (int i = 0; i < rawButtons.Length; i++) + rawButtons[i] = rawButtons[i].Trim(); #else string[] rawButtons = input.Split('+', StringSplitOptions.TrimEntries); #endif