From 39e7e064c9892b605245f8fb658ed07d1e41b78e Mon Sep 17 00:00:00 2001 From: Rangi Date: Thu, 9 Jul 2026 21:29:02 -0400 Subject: [PATCH] Print correct color set limit value in error message --- src/gfx/process.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gfx/process.cpp b/src/gfx/process.cpp index 0230f9ec..0b4459f1 100644 --- a/src/gfx/process.cpp +++ b/src/gfx/process.cpp @@ -1086,21 +1086,21 @@ void process() { } // This color set is incomparable with all previous ones, so add it as a new one - attrs.colorSetID = colorSets.size(); + if (colorSets.size() == AttrmapEntry::background) { // Check for overflow - fatal( - "Reached %zu color sets... sorry, this image is too much for me to handle :(", - AttrmapEntry::transparent - ); + fatal("Cannot create more than %zu color sets", colorSets.size()); } + attrs.colorSetID = colorSets.size(); + colorSets.push_back(colorSet); + if (checkVerbosity(VERB_DEBUG)) { fprintf( stderr, "- Tile (%" PRIu32 ", %" PRIu32 ") adds color set #%zu: [", tile.x, tile.y, - colorSets.size() + attrs.colorSetID ); for (uint16_t color : colorSet) { fprintf(stderr, "$%04x, ", color); @@ -1108,7 +1108,6 @@ void process() { fputs("]\n", stderr); } - colorSets.push_back(colorSet); continue_visiting_tiles:; }