From 8f5258fc22130727864d97a739c5a454a3757092 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 10 Aug 2016 20:31:18 +0100 Subject: [PATCH] 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. --- src/p_user.c | 2 +- src/r_draw.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 6ce9b8f48..e694d08a1 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -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. diff --git a/src/r_draw.c b/src/r_draw.c index 47688db03..b96afad98 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -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);