From 5a79d993810032a9b628c13f8192f3a1ac8ba830 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Wed, 12 Feb 2025 21:05:52 +0100 Subject: Fix remaining cpplint error that was introduced while trying to satisfy line-length limits. Introduced in mana/plus!88 and exposed in mana/plus!126 Pushing directly to master from top of !126 before merging 126. --- src/gui/windows/buydialog.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 2786671cd..f30fb92e4 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -762,14 +762,12 @@ void BuyDialog::updateButtonsAndLabels() mMaxItems = 1; // Calculate how many the player can carry - using namespace PlayerInfo; // trick for line-length. const int itemWeight = item->getInfo().getWeight(); - // Should be inside if, but line-length... - const int myTotalWeight = getAttribute(Attributes::TOTAL_WEIGHT); - const int myMaxWeight = getAttribute(Attributes::MAX_WEIGHT); if (itemWeight != 0) { - const int myFreeWeight = myMaxWeight - myTotalWeight; + const int myFreeWeight + = PlayerInfo::getAttribute(Attributes::MAX_WEIGHT) + - PlayerInfo::getAttribute(Attributes::TOTAL_WEIGHT); const int canCarry = myFreeWeight / itemWeight; mMaxItems = std::min(mMaxItems, canCarry); } -- cgit v1.2.3-70-g09d2