From 2f1db66e78975f265bd7e3f9064398928090130f Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 20 Aug 2023 07:23:07 -0400 Subject: [PATCH] Fix drawing of final color --- src/m_menu.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 3451b90d6..ff9d04c53 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -12183,21 +12183,36 @@ colordraw: { for (i = 0; i < 16; i++) { - if (skincolors[mc->color].accessible && !stoprow) + if (skincolors[mc->color].accessible) { M_DrawColorRamp(x + i*w, y + j*16, w, 1, skincolors[mc->color]); - if (mc->color == setupm_fakecolor->color) // store current color position - { - cx = x + i*w; - cy = y + j*16; - } + + if (mc == setupm_fakecolor) // store current color position + { + cx = x + i*w; + cy = y + j*16; + } } - mc = mc->next; - while (!skincolors[mc->color].accessible && !stoprow) // Find accessible color after this one + + if (stoprow) + { + break; + } + + // Find accessible color after this one + do { mc = mc->next; - if (mc == menucolortail) stoprow = true; - } + if (mc == menucolortail) + { + stoprow = true; + } + } while (!skincolors[mc->color].accessible && !stoprow); + } + + if (stoprow) + { + break; } }