From 807226b308f742c850a6bd52a1d3565abe0deb2f Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Fri, 24 Nov 2023 11:50:01 +0100 Subject: [PATCH] Fix "Cancel" button not working when using "toggle" missile mode (#111) --- YAMS-LIB/Program.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/YAMS-LIB/Program.cs b/YAMS-LIB/Program.cs index 8f4cca4..e562b6b 100644 --- a/YAMS-LIB/Program.cs +++ b/YAMS-LIB/Program.cs @@ -1592,6 +1592,9 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te ReplaceGMLInCode(chStepControlCode, "if (kMissile && kMissilePushedSteps == 1 && global.maxmissiles > 0", "if (kMissile && kMissilePushedSteps == 1"); ReplaceGMLInCode(chStepControlCode, "if (global.currentweapon == 1 && global.missiles == 0)", "if (global.currentweapon == 1 && (global.maxmissiles == 0 || global.missiles == 0))"); + // Fix weapon selection cancel with toggle + ReplaceGMLInCode(chStepControlCode, "if (kSelect && kSelectPushedSteps == 0 && global.maxmissiles > 0 && global.currentweapon != 0)", "if (kSelect && kSelectPushedSteps == 0 && (global.missiles > 0 || global.smissiles > 0 || global.pbombs > 0) && global.currentweapon != 0)"); + // Fix weapon selection with hold ReplaceGMLInCode(chStepControlCode, """ if (global.currentweapon == 0)