|
@@ -320,7 +320,7 @@ void BattleStacksController::showStackAmountBox(Canvas & canvas, const CStack *
|
|
|
if(settings["battle"]["showHealthBar"].Bool())
|
|
|
{
|
|
|
float health = stack->getMaxHealth();
|
|
|
- float healthRemaining = std::max(stack->getAvailableHealth() - (stack->getCount() - 1) * health, .0f);
|
|
|
+ float healthRemaining = std::min(std::max(stack->getAvailableHealth() - (stack->getCount() - 1) * health, .0f), health);
|
|
|
Rect r(boxPosition.x, boxPosition.y - 3, amountBG->width(), 4);
|
|
|
canvas.drawColor(r, Colors::RED);
|
|
|
canvas.drawColor(Rect(r.x, r.y, (r.w / health) * healthRemaining, r.h), Colors::GREEN);
|