From bfdfac004fe261239004662898b2b0bf8c1fee27 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 21 Apr 2022 03:22:01 -0500 Subject: [PATCH] GUI: fix ins 0 being inserted on blank song --- TODO.md | 1 - src/gui/gui.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 03e465ce..7204a6d1 100644 --- a/TODO.md +++ b/TODO.md @@ -21,7 +21,6 @@ - ability to customize startup system - store system presets in new file - Game Boy envelope macro/sequence -- Game Boy envelope view - option to display chip names instead of "multi-system" on title bar - rewrite the system name detection function anyway - add nightly.link diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 068eb11d..8993a7d7 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -915,6 +915,7 @@ void FurnaceGUI::noteInput(int num, int key, int vol) { } pat->data[cursor.y][1]=(unsigned char)pat->data[cursor.y][1]; if (latchIns==-2) { + if (curIns>=(int)e->song.ins.size()) curIns=-1; pat->data[cursor.y][2]=curIns; } else if (latchIns!=-1 && !e->song.ins.empty()) { pat->data[cursor.y][2]=MIN(((int)e->song.ins.size())-1,latchIns);