From 089666dd686a70495a0e5be4f2c082ac99763ac5 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 24 Feb 2018 15:13:14 +0300 Subject: [PATCH] Round up displayed encumbrance --- apps/openmw/mwgui/companionwindow.cpp | 4 +++- apps/openmw/mwgui/inventorywindow.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/companionwindow.cpp b/apps/openmw/mwgui/companionwindow.cpp index ad71be7df..c6ef2890d 100644 --- a/apps/openmw/mwgui/companionwindow.cpp +++ b/apps/openmw/mwgui/companionwindow.cpp @@ -1,5 +1,7 @@ #include "companionwindow.hpp" +#include + #include #include "../mwbase/environment.hpp" @@ -129,7 +131,7 @@ void CompanionWindow::updateEncumbranceBar() return; float capacity = mPtr.getClass().getCapacity(mPtr); float encumbrance = mPtr.getClass().getEncumbrance(mPtr); - mEncumbranceBar->setValue(static_cast(encumbrance), static_cast(capacity)); + mEncumbranceBar->setValue(std::ceil(encumbrance), static_cast(capacity)); if (mModel && mModel->hasProfit(mPtr)) { diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index aacc1314b..7bf8ad025 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -1,5 +1,6 @@ #include "inventorywindow.hpp" +#include #include #include @@ -598,7 +599,7 @@ namespace MWGui float capacity = player.getClass().getCapacity(player); float encumbrance = player.getClass().getEncumbrance(player); mTradeModel->adjustEncumbrance(encumbrance); - mEncumbranceBar->setValue(static_cast(encumbrance), static_cast(capacity)); + mEncumbranceBar->setValue(std::ceil(encumbrance), static_cast(capacity)); } void InventoryWindow::onFrame(float dt)