From 48d6ae8e53959619feaf909d2c3f856112b15908 Mon Sep 17 00:00:00 2001 From: Tatsuru <44866610+Ikkarin@users.noreply.github.com> Date: Mon, 24 Aug 2020 23:53:21 -0300 Subject: [PATCH] Decolorize players as intended --- src/p_enemy.c | 21 +++++++++++---------- src/p_spec.c | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index fd30f8e38..aa126d244 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8839,25 +8839,26 @@ void A_Dye(mobj_t *actor) INT32 locvar2 = var2; mobj_t *target = ((locvar1 && actor->target) ? actor->target : actor); - UINT8 color = (UINT8)locvar2; + UINT16 color = (UINT16)locvar2; if (LUA_CallAction("A_Dye", actor)) return; if (color >= numskincolors) return; - if (!color) - target->colorized = false; - else - target->colorized = true; - // What if it's a player? if (target->player) - { target->player->powers[pw_dye] = color; - return; - } - target->color = color; + if (!color) + { + target->colorized = false; + target->color = target->player ? target->player->skincolor : SKINCOLOR_NONE; + } + else if (!(target->player)) + { + target->colorized = true; + target->color = color; + } } // Function: A_MoveRelative diff --git a/src/p_spec.c b/src/p_spec.c index 1df212e1b..102c971a9 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1933,7 +1933,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller case 336: // object dye - once { INT32 triggercolor = (INT32)sides[triggerline->sidenum[0]].toptexture; - UINT8 color = (actor->player ? actor->player->powers[pw_dye] : actor->color); + UINT16 color = (actor->player ? actor->player->powers[pw_dye] : actor->color); boolean invert = (triggerline->flags & ML_NOCLIMB ? true : false); if (invert ^ (triggercolor != color))