Two changes to the supercolor stuff.

* Don't allow arbitrary numbers to be used for a skin's supercolor, only strings.
* Devmode is no fun allowed mode, so turn off the god hyper flash there.
This commit is contained in:
toasterbabe 2016-08-10 20:31:18 +01:00
parent b3b6d5c4f9
commit 8f5258fc22
2 changed files with 4 additions and 4 deletions

View File

@ -3415,7 +3415,7 @@ static void P_DoSuperStuff(player_t *player)
player->mo->health--;
}
player->mo->color = (player->pflags & PF_GODMODE)
player->mo->color = (player->pflags & PF_GODMODE && cv_debug == 0)
? (SKINCOLOR_SUPERSILVER1 + 5*((leveltime >> 1) % 7)) // A wholesome easter egg.
: skins[player->skin].supercolor + (unsigned)abs( ( (signed)(leveltime >> 1) % 9) - 4); // This is where super flashing is handled.

View File

@ -1159,9 +1159,9 @@ UINT8 R_GetColorByName(const char *name)
UINT8 R_GetSuperColorByName(const char *name)
{
UINT8 color = (UINT8)atoi(name);
if (color > MAXSKINCOLORS && color < MAXTRANSLATIONS)
return color;
UINT8 color; /* = (UINT8)atoi(name); -- This isn't relevant to S_SKIN, which is the only way it's accessible right now. Let's simplify things.
if (color > MAXSKINCOLORS && color < MAXTRANSLATIONS && !((color - MAXSKINCOLORS) % 5))
return color;*/
for (color = 0; color < NUMSUPERCOLORS; color++)
if (!stricmp(Color_Names[color + MAXSKINCOLORS], name))
return ((color*5) + MAXSKINCOLORS);