From dff25ba3ef8724b4f26f978df27dec1e337ce23c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Dec 2014 15:11:52 +0300 Subject: Add chat command for move all except 1 items from inventory to storage. New command: /invtostorageall1 INDEX Alias: /invstorageall1 INDEX --- src/actions/actions.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/actions/actions.cpp') diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 0b501bdbf..135fec27f 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1421,4 +1421,17 @@ impHandler(invToStorageHalf) return true; } +impHandler(invToStorageAll1) +{ + Item *const item = getItemByInvIndex(event); + if (!item) + return true; + + inventoryHandler->moveItem2(Inventory::INVENTORY, + item->getInvIndex(), + item->getQuantity() - 1, + Inventory::STORAGE); + return true; +} + } // namespace Actions -- cgit v1.2.3-60-g2f50