From cf05f8b3847665d711126b73f585d89554eef2b8 Mon Sep 17 00:00:00 2001 From: pionere Date: Sat, 27 Jul 2024 19:17:11 +0200 Subject: [PATCH] fix string-limit in stores --- Source/stores.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/stores.cpp b/Source/stores.cpp index e3de2e6e1a2..cd6fd66f4c7 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -209,7 +209,9 @@ void PrintSString(int x, int y, bool cjustflag, const char* str, BYTE col, int v sx = (gbWidePanel ? LTPANEL_X + 7 : STORE_PNL_X + 7) + x; sy = LTPANEL_Y + 20 + y * 12 + stextlines[y]._syoff; limit = gbWidePanel ? LTPANEL_WIDTH - 7 * 2 : STPANEL_WIDTH - 7 * 2; + limit -= x; if (cjustflag) { + // assert(x == 0); -- otherwise limit -= x; ? width = GetSmallStringWidth(str); if (width < limit) { sx += (limit - width) >> 1;