diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-02-12 21:05:52 +0100 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-02-12 21:28:03 +0100 |
commit | 5a79d993810032a9b628c13f8192f3a1ac8ba830 (patch) | |
tree | beeb78d3a9652a89210ab56cc766782be813b020 | |
parent | 98f7cf6e5893ecf5ab224194cee5f671253f8d1d (diff) | |
download | manaplus-5a79d993810032a9b628c13f8192f3a1ac8ba830.tar.gz manaplus-5a79d993810032a9b628c13f8192f3a1ac8ba830.tar.bz2 manaplus-5a79d993810032a9b628c13f8192f3a1ac8ba830.tar.xz manaplus-5a79d993810032a9b628c13f8192f3a1ac8ba830.zip |
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.
-rw-r--r-- | src/gui/windows/buydialog.cpp | 8 |
1 files 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); } |