From b0531dea2b6e8ca2d1e85226b62e2d8106da7700 Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Sat, 4 May 2024 20:56:05 +0200 Subject: [PATCH] Use float for mutation_bar formatting string Turns out giving int on %f in arm64 linux gives huge number --- Source/UserInterface/PerimeterShellUI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/UserInterface/PerimeterShellUI.cpp b/Source/UserInterface/PerimeterShellUI.cpp index b0bbf419..b1eb99f3 100644 --- a/Source/UserInterface/PerimeterShellUI.cpp +++ b/Source/UserInterface/PerimeterShellUI.cpp @@ -5854,8 +5854,8 @@ void FormatProgressText(std::string& cb, void* param) { terUnitSquad* pSquad = safe_cast((terUnitBase*)param); int elements = pSquad->squadMutationMolecula().elementCount(DAMAGE_FILTER_BASE); - int energy = static_cast(xm::round(pSquad->mutationEnergy() * 100)); - energy = std::max(0, energy); + float energy = pSquad->mutationEnergy() * 100.0f; + energy = clamp(energy, 0.0f, 100.0f); std::string text = qdTextDB::instance().getText("Interface.Tips.Mutation_bar"); std::vector newlines;