summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-24 15:31:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-24 15:31:06 +0300
commit3f5c128b889b4cb41f9782fe1531c55e7d07432f (patch)
treeb5903e10142f876d29bf4d4643261f1b058fefe9
parentc53839e9125a72e2bbc5e479934b5b9111bef5d6 (diff)
downloadmanaverse-3f5c128b889b4cb41f9782fe1531c55e7d07432f.tar.gz
manaverse-3f5c128b889b4cb41f9782fe1531c55e7d07432f.tar.bz2
manaverse-3f5c128b889b4cb41f9782fe1531c55e7d07432f.tar.xz
manaverse-3f5c128b889b4cb41f9782fe1531c55e7d07432f.zip
Move inventory type into separate file.
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/actions/actions.cpp24
-rw-r--r--src/being/playerinfo.cpp7
-rw-r--r--src/enums/inventorytype.h39
-rw-r--r--src/gui/popups/popupmenu.cpp8
-rw-r--r--src/gui/widgets/itemcontainer.cpp24
-rw-r--r--src/gui/windows/inventorywindow.cpp56
-rw-r--r--src/gui/windows/itemamountwindow.cpp8
-rw-r--r--src/gui/windows/ministatuswindow.cpp2
-rw-r--r--src/gui/windows/npcdialog.cpp2
-rw-r--r--src/gui/windows/tradewindow.cpp4
-rw-r--r--src/inventory.cpp6
-rw-r--r--src/inventory.h15
-rw-r--r--src/net/ea/inventoryhandler.cpp10
-rw-r--r--src/net/ea/inventoryhandler.h6
-rw-r--r--src/net/eathena/inventoryhandler.cpp18
-rw-r--r--src/net/tmwa/inventoryhandler.cpp6
18 files changed, 132 insertions, 105 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7fa11260f..e10873bea 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -892,6 +892,7 @@ SET(SRCS
enums/dragdropsource.h
enums/equipslot.h
enums/guildpositionflags.h
+ enums/inventorytype.h
particle/imageparticle.cpp
particle/imageparticle.h
imagesprite.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 14903e063..46a7b6877 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1017,6 +1017,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
enums/dragdropsource.h \
enums/equipslot.h \
enums/guildpositionflags.h \
+ enums/inventorytype.h \
particle/imageparticle.cpp \
particle/imageparticle.h \
imagesprite.cpp \
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index ce53eaed9..2cff275f5 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -220,12 +220,12 @@ static Item *getItemByInvIndex(const InputEvent &event, const int invType)
const Inventory *inv = nullptr;
switch (invType)
{
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
inv = PlayerInfo::getStorageInventory();
break;
default:
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
inv = PlayerInfo::getInventory();
break;
}
@@ -430,7 +430,7 @@ impHandler(dropItemId)
impHandler(dropItemInv)
{
- Item *const item = getItemByInvIndex(event, Inventory::INVENTORY);
+ Item *const item = getItemByInvIndex(event, InventoryType::INVENTORY);
if (item && !PlayerInfo::isItemProtected(item->getId()))
{
ItemAmountWindow::showWindow(ItemAmountWindow::ItemDrop,
@@ -455,7 +455,7 @@ impHandler(dropItemIdAll)
impHandler(dropItemInvAll)
{
- Item *const item = getItemByInvIndex(event, Inventory::INVENTORY);
+ Item *const item = getItemByInvIndex(event, InventoryType::INVENTORY);
if (item && !PlayerInfo::isItemProtected(item->getId()))
PlayerInfo::dropItem(item, item->getQuantity(), true);
return true;
@@ -1431,7 +1431,7 @@ impHandler(useItem)
impHandler(useItemInv)
{
- Item *const item = getItemByInvIndex(event, Inventory::INVENTORY);
+ Item *const item = getItemByInvIndex(event, InventoryType::INVENTORY);
PlayerInfo::useEquipItem(item, true);
return true;
}
@@ -1439,13 +1439,13 @@ impHandler(useItemInv)
impHandler(invToStorage)
{
Item *item = nullptr;
- const int amount = getAmountFromEvent(event, item, Inventory::INVENTORY);
+ const int amount = getAmountFromEvent(event, item, InventoryType::INVENTORY);
if (amount)
{
- inventoryHandler->moveItem2(Inventory::INVENTORY,
+ inventoryHandler->moveItem2(InventoryType::INVENTORY,
item->getInvIndex(),
amount,
- Inventory::STORAGE);
+ InventoryType::STORAGE);
}
else
{
@@ -1458,7 +1458,7 @@ impHandler(invToStorage)
impHandler(tradeAdd)
{
Item *item = nullptr;
- const int amount = getAmountFromEvent(event, item, Inventory::INVENTORY);
+ const int amount = getAmountFromEvent(event, item, InventoryType::INVENTORY);
if (!item || PlayerInfo::isItemProtected(item->getId()))
return true;
@@ -1477,13 +1477,13 @@ impHandler(tradeAdd)
impHandler(storageToInv)
{
Item *item = nullptr;
- const int amount = getAmountFromEvent(event, item, Inventory::STORAGE);
+ const int amount = getAmountFromEvent(event, item, InventoryType::STORAGE);
if (amount)
{
- inventoryHandler->moveItem2(Inventory::STORAGE,
+ inventoryHandler->moveItem2(InventoryType::STORAGE,
item->getInvIndex(),
amount,
- Inventory::INVENTORY);
+ InventoryType::INVENTORY);
}
else
{
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index 2016454da..eb26ab892 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -26,12 +26,13 @@
#include "inventory.h"
#include "itemsoundmanager.h"
-
#include "being/homunculusinfo.h"
#include "being/localplayer.h"
#include "being/mercenaryinfo.h"
#include "being/petinfo.h"
+#include "enums/inventorytype.h"
+
#include "enums/being/attributes.h"
#include "gui/windows/inventorywindow.h"
@@ -427,10 +428,10 @@ void stateChange(const State state)
{
if (!mInventory)
{
- mInventory = new Inventory(Inventory::INVENTORY);
+ mInventory = new Inventory(InventoryType::INVENTORY);
mEquipment = new Equipment();
#ifdef EATHENA_SUPPORT
- mCartInventory = new Inventory(Inventory::CART);
+ mCartInventory = new Inventory(InventoryType::CART);
#endif
}
}
diff --git a/src/enums/inventorytype.h b/src/enums/inventorytype.h
new file mode 100644
index 000000000..6ba30b2a4
--- /dev/null
+++ b/src/enums/inventorytype.h
@@ -0,0 +1,39 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2004-2009 The Mana World Development Team
+ * Copyright (C) 2009-2010 The Mana Developers
+ * Copyright (C) 2011-2015 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ENUMS_INVENTORYTYPE_H
+#define ENUMS_INVENTORYTYPE_H
+
+namespace InventoryType
+{
+ enum Type
+ {
+ INVENTORY = 0,
+ STORAGE,
+ CART,
+ TRADE,
+ NPC,
+ TYPE_END
+ };
+} // namespace InventoryType
+
+#endif // ENUMS_INVENTORYTYPE_H
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 365970fa4..af207dffe 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1631,7 +1631,7 @@ void PopupMenu::showPopup(Window *const parent,
switch (type)
{
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
if (tradeWindow && tradeWindow->isWindowVisible() && !isProtected)
{
// TRANSLATORS: popup menu item
@@ -1693,7 +1693,7 @@ void PopupMenu::showPopup(Window *const parent,
addUseDrop(item, isProtected);
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
// TRANSLATORS: popup menu item
// TRANSLATORS: get item from storage
mBrowserBox->addRow("/storagetoinv 'INVINDEX'", _("Retrieve"));
@@ -1721,8 +1721,8 @@ void PopupMenu::showPopup(Window *const parent,
}
break;
- case Inventory::CART:
- case Inventory::TRADE:
+ case InventoryType::CART:
+ case InventoryType::TRADE:
default:
break;
}
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 391f9d741..528e751fb 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -411,16 +411,16 @@ void ItemContainer::mousePressed(MouseEvent &event)
DragDropSource src = DRAGDROP_SOURCE_EMPTY;
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
src = DRAGDROP_SOURCE_INVENTORY;
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
src = DRAGDROP_SOURCE_STORAGE;
break;
- case Inventory::TRADE:
+ case InventoryType::TRADE:
src = DRAGDROP_SOURCE_TRADE;
break;
- case Inventory::NPC:
+ case InventoryType::NPC:
src = DRAGDROP_SOURCE_NPC;
break;
default:
@@ -506,16 +506,16 @@ void ItemContainer::mouseReleased(MouseEvent &event)
DragDropSource dst = DRAGDROP_SOURCE_EMPTY;
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
dst = DRAGDROP_SOURCE_INVENTORY;
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
dst = DRAGDROP_SOURCE_STORAGE;
break;
- case Inventory::TRADE:
+ case InventoryType::TRADE:
dst = DRAGDROP_SOURCE_TRADE;
break;
- case Inventory::NPC:
+ case InventoryType::NPC:
dst = DRAGDROP_SOURCE_NPC;
break;
default:
@@ -528,15 +528,15 @@ void ItemContainer::mouseReleased(MouseEvent &event)
if (src == DRAGDROP_SOURCE_INVENTORY
&& dst == DRAGDROP_SOURCE_STORAGE)
{
- srcContainer = Inventory::INVENTORY;
- dstContainer = Inventory::STORAGE;
+ srcContainer = InventoryType::INVENTORY;
+ dstContainer = InventoryType::STORAGE;
inventory = PlayerInfo::getInventory();
}
else if (src == DRAGDROP_SOURCE_STORAGE
&& dst == DRAGDROP_SOURCE_INVENTORY)
{
- srcContainer = Inventory::STORAGE;
- dstContainer = Inventory::INVENTORY;
+ srcContainer = InventoryType::STORAGE;
+ dstContainer = InventoryType::INVENTORY;
inventory = PlayerInfo::getStorageInventory();
}
if (src == DRAGDROP_SOURCE_INVENTORY
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 80f9cc5fd..535f87f59 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -117,18 +117,18 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
setWindowName(inventory->getName());
switch (inventory->getType())
{
- case Inventory::INVENTORY:
- case Inventory::TRADE:
- case Inventory::NPC:
+ case InventoryType::INVENTORY:
+ case InventoryType::TRADE:
+ case InventoryType::NPC:
default:
mSortDropDown->setSelected(config.getIntValue(
"inventorySortOrder"));
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
mSortDropDown->setSelected(config.getIntValue(
"storageSortOrder"));
break;
- case Inventory::CART:
+ case InventoryType::CART:
mSortDropDown->setSelected(config.getIntValue(
"cartSortOrder"));
break;
@@ -176,7 +176,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
{
// TRANSLATORS: inventory button
const std::string equip = _("Equip");
@@ -233,7 +233,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
break;
}
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
{
// TRANSLATORS: storage button
mStoreButton = new Button(this, _("Store"), "store", this);
@@ -255,7 +255,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
break;
}
- case Inventory::CART:
+ case InventoryType::CART:
{
// TRANSLATORS: storage button
mStoreButton = new Button(this, _("Store"), "store", this);
@@ -278,8 +278,8 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
}
default:
- case Inventory::TRADE:
- case Inventory::NPC:
+ case InventoryType::TRADE:
+ case InventoryType::NPC:
break;
};
@@ -310,7 +310,7 @@ void InventoryWindow::postInit()
mItems->setSortType(mSortDropDown->getSelected());
widgetResized(Event(nullptr));
- if (mInventory->getType() == Inventory::INVENTORY)
+ if (mInventory->getType() == InventoryType::INVENTORY)
setVisible(true);
}
@@ -332,18 +332,18 @@ void InventoryWindow::storeSortOrder() const
{
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
- case Inventory::TRADE:
- case Inventory::NPC:
+ case InventoryType::INVENTORY:
+ case InventoryType::TRADE:
+ case InventoryType::NPC:
default:
config.setValue("inventorySortOrder",
mSortDropDown->getSelected());
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
config.setValue("storageSortOrder",
mSortDropDown->getSelected());
break;
- case Inventory::CART:
+ case InventoryType::CART:
config.setValue("cartSortOrder",
mSortDropDown->getSelected());
break;
@@ -421,9 +421,9 @@ void InventoryWindow::action(const ActionEvent &event)
{
if (isStorageActive())
{
- inventoryHandler->moveItem2(Inventory::INVENTORY,
+ inventoryHandler->moveItem2(InventoryType::INVENTORY,
item->getInvIndex(), item->getQuantity(),
- Inventory::STORAGE);
+ InventoryType::STORAGE);
}
else
{
@@ -526,9 +526,9 @@ void InventoryWindow::mouseClicked(MouseEvent &event)
}
else
{
- inventoryHandler->moveItem2(Inventory::INVENTORY,
+ inventoryHandler->moveItem2(InventoryType::INVENTORY,
item->getInvIndex(), item->getQuantity(),
- Inventory::STORAGE);
+ InventoryType::STORAGE);
}
}
else
@@ -540,9 +540,9 @@ void InventoryWindow::mouseClicked(MouseEvent &event)
}
else
{
- inventoryHandler->moveItem2(Inventory::STORAGE,
+ inventoryHandler->moveItem2(InventoryType::STORAGE,
item->getInvIndex(), item->getQuantity(),
- Inventory::INVENTORY);
+ InventoryType::INVENTORY);
}
}
}
@@ -711,23 +711,23 @@ void InventoryWindow::close()
{
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
- case Inventory::CART:
+ case InventoryType::INVENTORY:
+ case InventoryType::CART:
setVisible(false);
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
if (inventoryHandler)
{
- inventoryHandler->closeStorage(Inventory::STORAGE);
+ inventoryHandler->closeStorage(InventoryType::STORAGE);
inventoryHandler->forgotStorage();
}
scheduleDelete();
break;
default:
- case Inventory::TRADE:
- case Inventory::NPC:
+ case InventoryType::TRADE:
+ case InventoryType::NPC:
break;
}
}
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp
index 0715a2bbe..19d18eef8 100644
--- a/src/gui/windows/itemamountwindow.cpp
+++ b/src/gui/windows/itemamountwindow.cpp
@@ -69,12 +69,12 @@ void ItemAmountWindow::finish(const Item *const item,
inventoryHandler->splitItem(item, amount);
break;
case StoreAdd:
- inventoryHandler->moveItem2(Inventory::INVENTORY,
- item->getInvIndex(), amount, Inventory::STORAGE);
+ inventoryHandler->moveItem2(InventoryType::INVENTORY,
+ item->getInvIndex(), amount, InventoryType::STORAGE);
break;
case StoreRemove:
- inventoryHandler->moveItem2(Inventory::STORAGE,
- item->getInvIndex(), amount, Inventory::INVENTORY);
+ inventoryHandler->moveItem2(InventoryType::STORAGE,
+ item->getInvIndex(), amount, InventoryType::INVENTORY);
break;
case ShopBuyAdd:
if (shopWindow)
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index 02f1f8400..ec2cf05b2 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -527,7 +527,7 @@ void MiniStatusWindow::slotsChanged(Inventory *const inventory)
if (!inventory)
return;
- if (inventory->getType() == Inventory::INVENTORY)
+ if (inventory->getType() == InventoryType::INVENTORY)
StatusWindow::updateInvSlotsBar(mInvSlotsBar);
}
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 6eeb3153f..fa5cb21d7 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -116,7 +116,7 @@ NpcDialog::NpcDialog(const int npcId) :
mButton3(new Button(this, _("Add"), "add", this)),
// TRANSLATORS: npc dialog button
mResetButton(new Button(this, _("Reset"), "reset", this)),
- mInventory(new Inventory(Inventory::NPC, 1)),
+ mInventory(new Inventory(InventoryType::NPC, 1)),
mItemContainer(new ItemContainer(this, mInventory)),
mItemScrollArea(new ScrollArea(this, mItemContainer,
getOptionBool("showitemsbackground"), "npc_listbackground.xml")),
diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp
index 1ed169181..c15e56f44 100644
--- a/src/gui/windows/tradewindow.cpp
+++ b/src/gui/windows/tradewindow.cpp
@@ -75,8 +75,8 @@ TradeWindow::TradeWindow() :
Window(_("Trade: You"), false, nullptr, "trade.xml"),
ActionListener(),
SelectionListener(),
- mMyInventory(new Inventory(Inventory::TRADE)),
- mPartnerInventory(new Inventory(Inventory::TRADE)),
+ mMyInventory(new Inventory(InventoryType::TRADE)),
+ mPartnerInventory(new Inventory(InventoryType::TRADE)),
mMyItemContainer(new ItemContainer(this, mMyInventory)),
mPartnerItemContainer(new ItemContainer(this, mPartnerInventory)),
// TRANSLATORS: trade window money label
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 4c13db1a4..be480f743 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -292,18 +292,18 @@ std::string Inventory::getName() const
{
switch (mType)
{
- case INVENTORY:
+ case InventoryType::INVENTORY:
default:
{
// TRANSLATORS: inventory type name
return N_("Inventory");
}
- case STORAGE:
+ case InventoryType::STORAGE:
{
// TRANSLATORS: inventory type name
return N_("Storage");
}
- case CART:
+ case InventoryType::CART:
{
// TRANSLATORS: inventory type name
return N_("Cart");
diff --git a/src/inventory.h b/src/inventory.h
index 42ec86882..8438f63d7 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -23,6 +23,8 @@
#ifndef INVENTORY_H
#define INVENTORY_H
+#include "enums/inventorytype.h"
+
#include "enums/being/gender.h"
#include <list>
@@ -40,17 +42,6 @@ class Inventory final
static const int NO_SLOT_INDEX = -1; /**< Slot has no index. */
- enum
- {
- INVENTORY = 0,
- STORAGE,
- CART,
- TRADE,
- NPC,
- TYPE_END
- };
-
-
/**
* Constructor.
*
@@ -161,7 +152,7 @@ class Inventory final
{ return mType; }
bool isMainInventory() const A_WARN_UNUSED
- { return mType == INVENTORY; }
+ { return mType == InventoryType::INVENTORY; }
const Item *findItemBySprite(std::string spritePath,
const Gender::Type gender,
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 1be2e5be2..e81b0a490 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -130,14 +130,14 @@ size_t InventoryHandler::getSize(const int type) const
{
switch (type)
{
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
return 100;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
return 0; // Comes from server after items
- case Inventory::TRADE:
+ case InventoryType::TRADE:
return 12;
// GUILD_STORAGE
- case Inventory::TYPE_END:
+ case InventoryType::TYPE_END:
return 0; // Comes from server after items
default:
return 0;
@@ -248,7 +248,7 @@ void InventoryHandler::processPlayerStorageStatus(Net::MessageIn &msg)
const int size = msg.readInt16("max size");
if (!mStorage)
- mStorage = new Inventory(Inventory::STORAGE, size);
+ mStorage = new Inventory(InventoryType::STORAGE, size);
FOR_EACH (Ea::InventoryItems::const_iterator, it, mInventoryItems)
{
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index 0b9c208cc..be9fb0e52 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -48,12 +48,6 @@ typedef std::queue<int> PickupQueue;
class InventoryHandler notfinal : public Net::InventoryHandler
{
public:
- enum
- {
- GUILD_STORAGE = Inventory::TYPE_END,
- CART
- };
-
A_DELETE_COPY(InventoryHandler)
virtual ~InventoryHandler();
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index da8091f98..d8001b74f 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -264,26 +264,26 @@ void InventoryHandler::moveItem2(const int source,
{
int packet = 0;
int offset = INVENTORY_OFFSET;
- if (source == Inventory::INVENTORY)
+ if (source == InventoryType::INVENTORY)
{
- if (destination == Inventory::STORAGE)
+ if (destination == InventoryType::STORAGE)
packet = CMSG_MOVE_TO_STORAGE;
- else if (destination == Inventory::CART)
+ else if (destination == InventoryType::CART)
packet = CMSG_MOVE_TO_CART;
}
- else if (source == Inventory::STORAGE)
+ else if (source == InventoryType::STORAGE)
{
offset = STORAGE_OFFSET;
- if (destination == Inventory::INVENTORY)
+ if (destination == InventoryType::INVENTORY)
packet = CSMG_MOVE_FROM_STORAGE;
- else if (destination == Inventory::CART)
+ else if (destination == InventoryType::CART)
packet = CMSG_MOVE_FROM_STORAGE_TO_CART;
}
- else if (source == Inventory::CART)
+ else if (source == InventoryType::CART)
{
- if (destination == Inventory::INVENTORY)
+ if (destination == InventoryType::INVENTORY)
packet = CMSG_MOVE_FROM_CART;
- else if (destination == Inventory::STORAGE)
+ else if (destination == InventoryType::STORAGE)
packet = CMSG_MOVE_FROM_CART_TO_STORAGE;
}
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index 8fa8a497e..7821d9aca 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -223,15 +223,15 @@ void InventoryHandler::closeStorage(const int type A_UNUSED) const
void InventoryHandler::moveItem2(const int source, const int slot,
const int amount, const int destination) const
{
- if (source == Inventory::INVENTORY && destination == Inventory::STORAGE)
+ if (source == InventoryType::INVENTORY && destination == InventoryType::STORAGE)
{
createOutPacket(CMSG_MOVE_TO_STORAGE);
outMsg.writeInt16(static_cast<int16_t>(slot + INVENTORY_OFFSET),
"index");
outMsg.writeInt32(amount, "amount");
}
- else if (source == Inventory::STORAGE
- && destination == Inventory::INVENTORY)
+ else if (source == InventoryType::STORAGE
+ && destination == InventoryType::INVENTORY)
{
createOutPacket(CSMG_MOVE_FROM_STORAGE);
outMsg.writeInt16(static_cast<int16_t>(slot + STORAGE_OFFSET),