mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Range check
This commit is contained in:
parent
4221f08a7c
commit
7b3cc02ddc
2 changed files with 6 additions and 3 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue