diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-24 15:31:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-24 15:31:06 +0300 |
commit | 3f5c128b889b4cb41f9782fe1531c55e7d07432f (patch) | |
tree | b5903e10142f876d29bf4d4643261f1b058fefe9 /src/actions | |
parent | c53839e9125a72e2bbc5e479934b5b9111bef5d6 (diff) | |
download | plus-3f5c128b889b4cb41f9782fe1531c55e7d07432f.tar.gz plus-3f5c128b889b4cb41f9782fe1531c55e7d07432f.tar.bz2 plus-3f5c128b889b4cb41f9782fe1531c55e7d07432f.tar.xz plus-3f5c128b889b4cb41f9782fe1531c55e7d07432f.zip |
Move inventory type into separate file.
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/actions.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
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 { |