Codechange: Remove direct access to _colour_gradient.

Access is now through GetColourGradient, which ensures parameters are in range.
This commit is contained in:
Peter Nelson
2023-12-24 22:51:55 +00:00
committed by Peter Nelson
parent 56cf89d189
commit 0463d4c198
23 changed files with 98 additions and 65 deletions

View File

@@ -493,8 +493,8 @@ bool IsValidConsoleColour(TextColour c)
/* A text colour from the palette is used; must be the company
* colour gradient, so it must be one of those. */
c &= ~TC_IS_PALETTE_COLOUR;
for (uint i = COLOUR_BEGIN; i < COLOUR_END; i++) {
if (_colour_gradient[i][4] == c) return true;
for (Colours i = COLOUR_BEGIN; i < COLOUR_END; i++) {
if (GetColourGradient(i, 4) == c) return true;
}
return false;