summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/actions/actions.cpp14
-rw-r--r--src/actions/actions.h1
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h9
4 files changed, 25 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);
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index e46935ea2..9d2e64993 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -501,6 +501,7 @@ namespace InputAction
NAVIGATE_TO,
CAMERA_MOVE,
DROP_ITEM,
+ DROP_ITEM_ALL,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 8515dad5b..3b0854cfc 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -4252,6 +4252,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputCondition::INGAME,
"dropitem",
true},
+ {"keyDropItemAll",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::dropItemIdAll,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "dropitemall",
+ true},
};
#endif // INPUT_INPUTACTIONMAP_H