1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

fix wrong value if unit dead

This commit is contained in:
Laserlicht 2023-12-24 01:06:02 +01:00 committed by GitHub
parent f0c97b344a
commit 4f8dcb0f33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -483,7 +483,7 @@ void StackInfoBasicPanel::initializeData(const CStack * stack)
auto luck = stack->luckVal();
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*/
labels.push_back(std::make_shared<CLabel>(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[380] + ":"));