Fix custom skincolors being inaccessible in menus (closes #59)

This commit is contained in:
GenericHeroGuy 2025-09-04 23:32:01 +02:00
parent 244dde08eb
commit 1a7b21f8db
3 changed files with 8 additions and 9 deletions

View file

@ -2234,9 +2234,13 @@ void CV_AddValue(consvar_t *var, INT32 increment)
// Special case for the playercolor variable, used only directly from the menu
newvalue = var->value;
if (increment > 0) // Going up!
newvalue = M_GetColorAfter(newvalue);
do
newvalue = M_GetColorAfter(newvalue);
while (!skincolors[newvalue].accessible);
else if (increment < 0) // Going down!
newvalue = M_GetColorBefore(newvalue);
do
newvalue = M_GetColorBefore(newvalue);
while (!skincolors[newvalue].accessible);
}
else
newvalue = var->value + increment;

View file

@ -290,9 +290,9 @@ INT32 DEH_ReadFreeslot(const char *type, const char *word, INT32 *out)
}
CONS_Printf("Skincolor SKINCOLOR_%s allocated.\n",word);
DEH_Link(word, &skincolors[numskincolors].info, &skincolornames);
M_AddMenuColor(numskincolors);
M_AddMenuColor(numskincolors++);
K_ReloadHUDColorCvar();
*out = numskincolors++;
*out = numskincolors;
return 0;
}
else if (fastcmp(type, "SPR2"))

View file

@ -7037,11 +7037,6 @@ INT32 MR_QuitMultiPlayerMenu(INT32 choice)
void M_AddMenuColor(UINT16 color) {
menucolor_t *c;
// SRB2Kart: I do not understand vanilla doesn't need this but WE do???!?!??!
if (!skincolors[color].accessible) {
return;
}
if (color >= numskincolors) {
CONS_Printf("M_AddMenuColor: color %d does not exist.",color);
return;