diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/outfitwindow.cpp | 3 | ||||
-rw-r--r-- | src/gui/selldialog.cpp | 12 | ||||
-rw-r--r-- | src/gui/setup_video.h | 3 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 4 |
4 files changed, 9 insertions, 13 deletions
diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index f548116f6..dbe084c17 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -260,13 +260,12 @@ void OutfitWindow::wearOutfit(const int outfit, const bool unwearEmpty, { bool isEmpty = true; - const Item *item; if (outfit < 0 || outfit > static_cast<int>(OUTFITS_COUNT)) return; for (unsigned i = 0; i < OUTFIT_ITEM_COUNT; i++) { - item = PlayerInfo::getInventory()->findItem( + const Item *const item = PlayerInfo::getInventory()->findItem( mItems[outfit][i], mItemColors[outfit][i]); if (item && !item->isEquipped() && item->getQuantity()) { diff --git a/src/gui/selldialog.cpp b/src/gui/selldialog.cpp index cb9a5abf8..e9ec38423 100644 --- a/src/gui/selldialog.cpp +++ b/src/gui/selldialog.cpp @@ -226,7 +226,6 @@ void SellDialog::action(const gcn::ActionEvent &event) { // Attempt sell ShopItem *const item = mShopItems->at(selectedItem); - int sellCount, itemIndex; mPlayerMoney += mAmountItems * mShopItems->at(selectedItem)->getPrice(); mMaxItems -= mAmountItems; @@ -234,16 +233,17 @@ void SellDialog::action(const gcn::ActionEvent &event) { // This order is important, item->getCurrentInvIndex() would return // the inventory index of the next Duplicate otherwise. - itemIndex = item->getCurrentInvIndex(); - sellCount = item->sellCurrentDuplicate(mAmountItems); - + const int sellCount = item->sellCurrentDuplicate(mAmountItems); #ifdef MANASERV_SUPPORT + int itemIndex = item->getCurrentInvIndex(); // For Manaserv, the Item id is to be given as index. if ((Net::getNetworkType() == ServerInfo::MANASERV)) itemIndex = item->getId(); -#endif - Net::getNpcHandler()->sellItem(mNpcId, itemIndex, sellCount); +#else + Net::getNpcHandler()->sellItem(mNpcId, + item->getCurrentInvIndex(), sellCount); +#endif mAmountItems -= sellCount; } diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h index 8ccfa5bb2..dc1a180b3 100644 --- a/src/gui/setup_video.h +++ b/src/gui/setup_video.h @@ -70,9 +70,6 @@ class Setup_Video final : public SetupTab, public gcn::KeyListener OpenGLListModel *mOpenGLListModel; - Label *scrollRadiusLabel; - Label *scrollLazinessLabel; - ListBox *mModeList; CheckBox *mFsCheckBox; DropDown *mOpenGLDropDown; diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 2e4ff851b..e7e0a2766 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -152,10 +152,10 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) if (mScrollLaziness < 1) mScrollLaziness = 1; // Avoids division by zero - int cnt = 0; - if (mEnableLazyScrolling) { + int cnt = 0; + // Apply lazy scrolling while (lastTick < tick_time && cnt < 32) { |