From be1dd6434f993fba9e944cda9e83e0fae32e8c14 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Dec 2014 12:59:13 +0300 Subject: Add chat command for drop item by inventory index. New chat command: /dropinv INDEX --- src/actions/actions.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/actions/actions.cpp') diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 8cd2600b4..da62c6549 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -380,6 +380,22 @@ impHandler(dropItemId) return true; } +impHandler(dropItemInv) +{ + const Inventory *const inv = PlayerInfo::getInventory(); + if (!inv) + return false; + + Item *const item = inv->getItem(atoi(event.args.c_str())); + + if (item && !PlayerInfo::isItemProtected(item->getId())) + { + ItemAmountWindow::showWindow(ItemAmountWindow::ItemDrop, + inventoryWindow, item); + } + return true; +} + impHandler(dropItemIdAll) { const Inventory *const inv = PlayerInfo::getInventory(); -- cgit v1.2.3-70-g09d2