diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-12 23:14:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-12 23:14:56 +0300 |
commit | 4825eb0b1c940f17925eb70fc0155abd4443d4f2 (patch) | |
tree | b2e1591fcf1a946c18a6a5bf72026bee4f582ca3 /src/actions | |
parent | 23a89c57cbd36922fbcb92affa9546955591e9db (diff) | |
download | mv-4825eb0b1c940f17925eb70fc0155abd4443d4f2.tar.gz mv-4825eb0b1c940f17925eb70fc0155abd4443d4f2.tar.bz2 mv-4825eb0b1c940f17925eb70fc0155abd4443d4f2.tar.xz mv-4825eb0b1c940f17925eb70fc0155abd4443d4f2.zip |
Add chat command for drop all items in stack with given id.
New chat command: /dropitemall ID
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/actions.cpp | 14 | ||||
-rw-r--r-- | src/actions/actions.h | 1 |
2 files changed, 15 insertions, 0 deletions
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) diff --git a/src/actions/actions.h b/src/actions/actions.h index 956183346..11a3bcdcf 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -39,6 +39,7 @@ namespace Actions decHandler(dropItem0); decHandler(dropItem); decHandler(dropItemId); + decHandler(dropItemIdAll); decHandler(heal); decHandler(itenplz); decHandler(setHome); |