From f42c57d9a885450014cadd56a0eaf7c79eefebf4 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sun, 27 Nov 2011 05:01:38 +0200 Subject: Add IDropAction and related stuff --- src/game.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/game.cpp') 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"<