aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_client.cpp8
-rw-r--r--src/script/lua_api/l_client.h5
2 files changed, 12 insertions, 1 deletions
diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp
index b9a8f77a8..56ce6471c 100644
--- a/src/script/lua_api/l_client.cpp
+++ b/src/script/lua_api/l_client.cpp
@@ -496,6 +496,13 @@ int ModApiClient::l_set_keypress(lua_State *L)
return 1;
}
+// drop_selected_item()
+int ModApiClient::l_drop_selected_item(lua_State *L)
+{
+ g_game->dropSelectedItem();
+ return 0;
+}
+
void ModApiClient::Initialize(lua_State *L, int top)
{
API_FCT(get_current_modname);
@@ -528,4 +535,5 @@ void ModApiClient::Initialize(lua_State *L, int top)
API_FCT(dig_node);
API_FCT(get_inventory);
API_FCT(set_keypress);
+ API_FCT(drop_selected_item);
}
diff --git a/src/script/lua_api/l_client.h b/src/script/lua_api/l_client.h
index 1ea57f9ee..ebce7c02a 100644
--- a/src/script/lua_api/l_client.h
+++ b/src/script/lua_api/l_client.h
@@ -117,8 +117,11 @@ private:
// get_inventory(location)
static int l_get_inventory(lua_State *L);
- // l_set_keypress(key_setting, pressed)
+ // set_keypress(key_setting, pressed)
static int l_set_keypress(lua_State *L);
+
+ // drop_selected_item()
+ static int l_drop_selected_item(lua_State *L);
public:
static void Initialize(lua_State *L, int top);
};