aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-10-05 22:33:32 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-10-05 22:33:32 +0200
commitcb1915efa780292c7221bb14f38976967d7bcdab (patch)
tree8c0e87d77198aaa50ab03d74d3d3041800707cb8 /src/script/lua_api
parent43ee069dbf0dc805277fcee9f1ac8925da2a4061 (diff)
downloaddragonfireclient-cb1915efa780292c7221bb14f38976967d7bcdab.tar.xz
Added minetest.drop_selected_item(), Improved AutoEject
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);
};