diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-13 15:00:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-13 15:00:41 +0300 |
commit | b002d846243676990503aa0fa7c220e8a8e66de2 (patch) | |
tree | a451b3fe5157d01d657e92a1a06c8aa03b407b70 /src/actions/actions.cpp | |
parent | 9b4893583faada67faa7df938a35367328939a8f (diff) | |
download | plus-b002d846243676990503aa0fa7c220e8a8e66de2.tar.gz plus-b002d846243676990503aa0fa7c220e8a8e66de2.tar.bz2 plus-b002d846243676990503aa0fa7c220e8a8e66de2.tar.xz plus-b002d846243676990503aa0fa7c220e8a8e66de2.zip |
Add chat command for move half items from inventory to storage.
New command: /invtostoragehalf INDEX
Alias: /invstoragehalf INDEX
Diffstat (limited to 'src/actions/actions.cpp')
-rw-r--r-- | src/actions/actions.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index c3b2faf9f..0b501bdbf 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1408,4 +1408,17 @@ impHandler(invToStorage10) return true; } +impHandler(invToStorageHalf) +{ + Item *const item = getItemByInvIndex(event); + if (!item) + return true; + + inventoryHandler->moveItem2(Inventory::INVENTORY, + item->getInvIndex(), + item->getQuantity() / 2, + Inventory::STORAGE); + return true; +} + } // namespace Actions |