diff --git a/src/g_game.c b/src/g_game.c index 9ea51eba..9578cbf8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4336,7 +4336,7 @@ void G_GhostTicker(void) { case GHC_SUPER: // Super Sonic (P_DoSuperStuff) g->mo->color = SKINCOLOR_SUPER1; - g->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); + g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); break; case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS); diff --git a/src/p_user.c b/src/p_user.c index 72b08db9..51832119 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3449,7 +3449,7 @@ static void P_DoSuperStuff(player_t *player) case 2: /* Knux */ player->mo->color = SKINCOLOR_KSUPER1; break; default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break; } - player->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); + player->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN)) && !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy))