mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-03 00:46:55 +02:00
fix wrong value if unit dead
This commit is contained in:
@ -483,7 +483,7 @@ void StackInfoBasicPanel::initializeData(const CStack * stack)
|
|||||||
auto luck = stack->luckVal();
|
auto luck = stack->luckVal();
|
||||||
|
|
||||||
auto killed = stack->getKilled();
|
auto killed = stack->getKilled();
|
||||||
auto healthRemaining = TextOperations::formatMetric(stack->getAvailableHealth() - (stack->getCount() - 1) * health, 4);
|
auto healthRemaining = TextOperations::formatMetric(std::max(stack->getAvailableHealth() - (stack->getCount() - 1) * health, (si64)0), 4);
|
||||||
|
|
||||||
//primary stats*/
|
//primary stats*/
|
||||||
labels.push_back(std::make_shared<CLabel>(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[380] + ":"));
|
labels.push_back(std::make_shared<CLabel>(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[380] + ":"));
|
||||||
|
Reference in New Issue
Block a user