diff --git a/src/include/unit.h b/src/include/unit.h index 5e4073a48..0c5dcfbf4 100644 --- a/src/include/unit.h +++ b/src/include/unit.h @@ -472,6 +472,7 @@ struct _unit_ { unsigned Constructed : 1; /// unit is in construction unsigned Active : 1; /// unit is active for AI +#define MaxMana 255 /// maximal mana for units unsigned Mana : 8; /// mana points unsigned HP; /// hit points unsigned XP; /// experience points diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 9b477aa72..51063c739 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -1240,7 +1240,7 @@ global void UnitIncrementMana(void) --unit->Blink; } - if( unit->Type->CanCastSpell && unit->Mana!=255 ) { + if( unit->Type->CanCastSpell && unit->Mana!=MaxMana ) { unit->Mana++; // some frames delayed done my color cycling diff --git a/src/unit/unit_draw.cpp b/src/unit/unit_draw.cpp index dc6313d24..b574a4f4f 100644 --- a/src/unit/unit_draw.cpp +++ b/src/unit/unit_draw.cpp @@ -673,8 +673,8 @@ local void DrawDecoration(const Unit* unit,const UnitType* type,int x,int y) // Mana bar on right side of unit. FIXME: combine bar and sprite // if( ShowManaBar ) { - if( type->CanCastSpell && !(ShowNoFull && unit->Mana==255) ) { - DrawManaBar(x,y,type,255,unit->Mana); + if( type->CanCastSpell && !(ShowNoFull && unit->Mana==MaxMana) ) { + DrawManaBar(x,y,type,MaxMana,unit->Mana); } else if( type->GivesOil || type->GoldMine || type->OilPatch ) { DrawManaBar(x,y,type,655350,unit->Value); } @@ -736,8 +736,8 @@ local void DrawDecoration(const Unit* unit,const UnitType* type,int x,int y) // Mana dot on right side of unit. // if( ShowManaDot ) { - if( type->CanCastSpell && !(ShowNoFull && unit->Mana==255) ) { - DrawManaSprite(x,y,type,255,unit->Mana); + if( type->CanCastSpell && !(ShowNoFull && unit->Mana==MaxMana) ) { + DrawManaSprite(x,y,type,MaxMana,unit->Mana); } else if( type->GivesOil || type->GoldMine || type->OilPatch ) { DrawManaSprite(x,y,type,655350,unit->Value); }