From 4825eb0b1c940f17925eb70fc0155abd4443d4f2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 12 Dec 2014 23:14:56 +0300 Subject: Add chat command for drop all items in stack with given id. New chat command: /dropitemall ID --- src/actions/actions.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/actions/actions.cpp') diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 605a3ff06..8cd2600b4 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -380,6 +380,20 @@ impHandler(dropItemId) return true; } +impHandler(dropItemIdAll) +{ + const Inventory *const inv = PlayerInfo::getInventory(); + if (!inv) + return false; + + // +++ ignoring item color for now + Item *const item = inv->findItem(atoi(event.args.c_str()), 1); + + if (item && !PlayerInfo::isItemProtected(item->getId())) + PlayerInfo::dropItem(item, item->getQuantity(), true); + return true; +} + impHandler(heal) { if (actorManager && localPlayer) -- cgit v1.2.3-60-g2f50