aboutsummaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2011-11-27 05:01:38 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:54 +0200
commitf42c57d9a885450014cadd56a0eaf7c79eefebf4 (patch)
tree2ad93e18ac16b4b8c362a58ce046cb18be4d3e00 /src/game.cpp
parent82a460ec90b4537926f31603219504bce8817ac2 (diff)
downloadminetest-f42c57d9a885450014cadd56a0eaf7c79eefebf4.tar.gz
minetest-f42c57d9a885450014cadd56a0eaf7c79eefebf4.tar.bz2
minetest-f42c57d9a885450014cadd56a0eaf7c79eefebf4.zip
Add IDropAction and related stuff
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a7e1ccd82..1c555dbee 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1215,9 +1215,19 @@ void the_game(
input->step(dtime);
/*
- Launch menus according to keys
+ Launch menus and trigger stuff according to keys
*/
- if(input->wasKeyDown(getKeySetting("keymap_inventory")))
+ if(input->wasKeyDown(getKeySetting("keymap_drop")))
+ {
+ // drop selected item
+ IDropAction *a = new IDropAction();
+ a->count = 0;
+ a->from_inv = "current_player";
+ a->from_list = "main";
+ a->from_i = g_selected_item;
+ client.inventoryAction(a);
+ }
+ else if(input->wasKeyDown(getKeySetting("keymap_inventory")))
{
infostream<<"the_game: "
<<"Launching inventory"<<std::endl;