Range check

This commit is contained in:
Tatsuru 2020-01-11 21:38:10 -03:00
parent 4221f08a7c
commit 7b3cc02ddc
2 changed files with 6 additions and 3 deletions

View File

@ -8954,8 +8954,8 @@ void A_ChangeColorAbsolute(mobj_t *actor)
//
// Description: Colorizes an object.
//
// var1 = if (var1 > 0), dye your target instead of yourself
// var2 = if (var1 = 0), color value to dye
// var1 = if (var1 != 0), dye your target instead of yourself
// var2 = color value to dye
//
void A_Dye(mobj_t *actor)
{
@ -8968,6 +8968,9 @@ void A_Dye(mobj_t *actor)
mobj_t *target = ((locvar1 && actor->target) ? actor->target : actor);
UINT8 color = (UINT8)locvar2;
if (color >= MAXTRANSLATIONS)
return;
// What if it's a player?
if (target->player)
{

View File

@ -4061,7 +4061,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
if (mo)
{
if (color < 0 || color > MAXSKINCOLORS)
if (color < 0 || color >= MAXTRANSLATIONS)
return;
var1 = 0;