summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/actions/actions.cpp13
-rw-r--r--src/actions/actions.h1
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h9
4 files changed, 24 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)
diff --git a/src/actions/actions.h b/src/actions/actions.h
index ab7f5b980..3ccd916d0 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -41,6 +41,7 @@ namespace Actions
decHandler(dropItemId);
decHandler(dropItemInv);
decHandler(dropItemIdAll);
+ decHandler(dropItemInvAll);
decHandler(heal);
decHandler(itenplz);
decHandler(setHome);
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index fc14b1ad2..69dbe1147 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -503,6 +503,7 @@ namespace InputAction
DROP_ITEM,
DROP_ITEM_ALL,
DROP_INV,
+ DROP_INV_ALL,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 7859808b5..e22b12021 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -4270,6 +4270,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputCondition::INGAME,
"dropinv",
true},
+ {"keyDropInvAll",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::dropItemInvAll,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "dropinvall",
+ true},
};
#endif // INPUT_INPUTACTIONMAP_H