Permalink
Browse files

back to comparing against numerical values for the armor widget color

there are up to 4 DEHACKED variables to check against, plus two constant numerical values

play safe ans assume anything >1 is a blue armor

Yet again, this fixes #333
  • Loading branch information...
fabiangreffrath committed Sep 12, 2018
1 parent 45e39ce commit de66ad3aae3e7ee7d95f1da352073fbf86c650a3
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/doom/st_stuff.c
View
@@ -1590,11 +1590,9 @@ static byte* ST_WidgetColor(int i)
plyr->powers[pw_invulnerability])
return cr[CR_GRAY];
// [crispy] color by armor type
else if (plyr->armortype == 2 || // [crispy] MegaSphere
plyr->armortype == deh_blue_armor_class) // [crispy] MegaArmor
else if (plyr->armortype >= 2)
return cr[CR_BLUE];
else if (plyr->armortype == 1 || // [crispy] armor helmets
plyr->armortype == deh_green_armor_class) // [crispy] green armor shirt
else if (plyr->armortype == 1)
return cr[CR_GREEN];
else if (plyr->armortype == 0)
return cr[CR_RED];

1 comment on commit de66ad3

@Zodomaniac

This comment has been minimized.

Show comment
Hide comment
@Zodomaniac

Zodomaniac Sep 12, 2018

Collaborator

Yes, this one is more robust, I'm glad I didn't have to bother you by requesting this!
In previous revision, if some WAD maker assigned green armor class to 2 by dehacked, there would be a conflict: the colorization would set to green as plyr->armortype == deh_green_armor_class and to blue as plyr->armortype == 2. Nice that you've eliminated this ambiguity!

Collaborator

Zodomaniac commented on de66ad3 Sep 12, 2018

Yes, this one is more robust, I'm glad I didn't have to bother you by requesting this!
In previous revision, if some WAD maker assigned green armor class to 2 by dehacked, there would be a conflict: the colorization would set to green as plyr->armortype == deh_green_armor_class and to blue as plyr->armortype == 2. Nice that you've eliminated this ambiguity!

Please sign in to comment.