From b13c002c148a73271bfe6b672efd42012683aa5f Mon Sep 17 00:00:00 2001 From: Robin Eklind Date: Mon, 2 Aug 2021 10:27:33 +0200 Subject: [PATCH] control: add BUGFIX for loop termination in DrawGoldSplit --- Source/control.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/control.cpp b/Source/control.cpp index 0ea632df6..4ed5e0d3f 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -2618,6 +2618,7 @@ void DrawGoldSplit(int amount) PrintGameStr(388, 140, tempstr, COL_WHITE); } if (amount > 0) { + // BUGFIX: loop condition should be `tempstr[i] != 0`, not `i < tempstr[i]`. for (i = 0; i < tempstr[i]; i++) { BYTE c = fontframe[gbFontTransTbl[(BYTE)tempstr[i]]]; screen_x += fontkern[c] + 1;