summaryrefslogtreecommitdiff
path: root/src/actions/actions.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-13 13:08:24 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-13 13:08:24 +0300
commit1a539c37caa6b20762e0cbf45351b9941669006f (patch)
tree36f325d2fec37c800e9d1d6340dcf04823cadb18 /src/actions/actions.cpp
parent541874a24b10ce5db77a6ef2d952c0c4481af92a (diff)
downloadmanaplus-1a539c37caa6b20762e0cbf45351b9941669006f.tar.gz
manaplus-1a539c37caa6b20762e0cbf45351b9941669006f.tar.bz2
manaplus-1a539c37caa6b20762e0cbf45351b9941669006f.tar.xz
manaplus-1a539c37caa6b20762e0cbf45351b9941669006f.zip
Add chat command for drop all item by inventory index.
New chat command: /dropinvall INDEX
Diffstat (limited to 'src/actions/actions.cpp')
-rw-r--r--src/actions/actions.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index da62c6549..d28edf826 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -410,6 +410,19 @@ impHandler(dropItemIdAll)
return true;
}
+impHandler(dropItemInvAll)
+{
+ 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()))
+ PlayerInfo::dropItem(item, item->getQuantity(), true);
+ return true;
+}
+
impHandler(heal)
{
if (actorManager && localPlayer)