summaryrefslogtreecommitdiff
path: root/src/gui/selldialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-24 18:28:47 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-24 21:06:51 +0300
commita306ecf96736779b08d1de7ec994d3d741d5dc61 (patch)
tree5a64809354d2c5f672a34fc9578975ab76920b5b /src/gui/selldialog.cpp
parent6053e0797465a15da30b8d645c8ac7c95b596c69 (diff)
downloadmanaplus-a306ecf96736779b08d1de7ec994d3d741d5dc61.tar.gz
manaplus-a306ecf96736779b08d1de7ec994d3d741d5dc61.tar.bz2
manaplus-a306ecf96736779b08d1de7ec994d3d741d5dc61.tar.xz
manaplus-a306ecf96736779b08d1de7ec994d3d741d5dc61.zip
fix code style.
Diffstat (limited to 'src/gui/selldialog.cpp')
-rw-r--r--src/gui/selldialog.cpp12
1 files changed, 6 insertions, 6 deletions
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;
}