Skip to content

Commit e8ef120

Browse files
authored
bugfix(gui): Consistently show blue health bars for disabled objects (#1622)
1 parent e87031f commit e8ef120

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Generals/Code/GameEngine/Source/GameClient/Drawable.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3387,7 +3387,10 @@ void Drawable::drawHealthBar(const IRegion2D* healthBarRegion)
33873387
//
33883388

33893389
Color color, outlineColor;
3390-
if( obj->getStatusBits().test( OBJECT_STATUS_UNDER_CONSTRUCTION ) || (obj->isDisabled() && !obj->isDisabledByType(DISABLED_HELD)) )
3390+
DisabledMaskType mask = obj->getDisabledFlags();
3391+
mask.clear(MAKE_DISABLED_MASK(DISABLED_HELD));
3392+
3393+
if (obj->getStatusBits().test(OBJECT_STATUS_UNDER_CONSTRUCTION) || DISABLEDMASK_ANY_SET(mask))
33913394
{
33923395
color = GameMakeColor( 0, healthRatio * 255.0f, 255, 255 );//blue to cyan
33933396
outlineColor = GameMakeColor( 0, healthRatio * 128.0f, 128, 255 );//dark blue to dark cyan

GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3885,7 +3885,10 @@ void Drawable::drawHealthBar(const IRegion2D* healthBarRegion)
38853885
//
38863886

38873887
Color color, outlineColor;
3888-
if( obj->getStatusBits().test( OBJECT_STATUS_UNDER_CONSTRUCTION ) || (obj->isDisabled() && !obj->isDisabledByType(DISABLED_HELD)) )
3888+
DisabledMaskType mask = obj->getDisabledFlags();
3889+
mask.clear(MAKE_DISABLED_MASK(DISABLED_HELD));
3890+
3891+
if (obj->getStatusBits().test(OBJECT_STATUS_UNDER_CONSTRUCTION) || DISABLEDMASK_ANY_SET(mask))
38893892
{
38903893
color = GameMakeColor( 0, healthRatio * 255.0f, 255, 255 );//blue to cyan
38913894
outlineColor = GameMakeColor( 0, healthRatio * 128.0f, 128, 255 );//dark blue to dark cyan

0 commit comments

Comments
 (0)