From 4f8dcb0f33ce3926b66b8d043206e9b41628df4c Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Sun, 24 Dec 2023 01:06:02 +0100 Subject: [PATCH] fix wrong value if unit dead --- client/battle/BattleInterfaceClasses.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/battle/BattleInterfaceClasses.cpp b/client/battle/BattleInterfaceClasses.cpp index 52c132f8c..2764983b3 100644 --- a/client/battle/BattleInterfaceClasses.cpp +++ b/client/battle/BattleInterfaceClasses.cpp @@ -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(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[380] + ":"));