mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
Very (very) slightly less terrible G_CheckPlayerColor() function.
git-svn-id: https://svn.eduke32.com/eduke32@7133 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e7798d12dc
commit
69a1d8d953
3 changed files with 6 additions and 6 deletions
|
@ -4191,13 +4191,13 @@ int Menu_Change(MenuID_t cm)
|
|||
|
||||
|
||||
|
||||
void G_CheckPlayerColor(int32_t *color, int32_t prev_color)
|
||||
int G_CheckPlayerColor(int color)
|
||||
{
|
||||
for (int i : MEOSV_PLAYER_COLOR)
|
||||
if (*color == i)
|
||||
return;
|
||||
if (i == color)
|
||||
return color;
|
||||
|
||||
*color = prev_color;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -461,7 +461,7 @@ extern int32_t voting;
|
|||
int Menu_Change(int32_t cm);
|
||||
void Menu_AnimateChange(int32_t cm, MenuAnimationType_t animtype);
|
||||
int32_t Menu_IsTextInput(Menu_t *cm);
|
||||
void G_CheckPlayerColor(int32_t *color,int32_t prev_color);
|
||||
int G_CheckPlayerColor(int color);
|
||||
void Menu_Init(void);
|
||||
void Menu_Open(uint8_t playerID);
|
||||
void Menu_Close(uint8_t playerID);
|
||||
|
|
|
@ -1544,7 +1544,7 @@ static int32_t osdcmd_cvar_set_game(osdfuncparm_t const * const parm)
|
|||
}
|
||||
else if (!Bstrcasecmp(parm->name, "color"))
|
||||
{
|
||||
G_CheckPlayerColor((int32_t *)&ud.color,-1);
|
||||
ud.color = G_CheckPlayerColor(ud.color);
|
||||
g_player[0].ps->palookup = g_player[0].pcolor = ud.color;
|
||||
}
|
||||
else if (!Bstrcasecmp(parm->name, "osdscale"))
|
||||
|
|
Loading…
Reference in a new issue