summaryrefslogtreecommitdiff
path: root/library/LuaApi.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-09-14 18:49:02 +0400
committerAlexander Gavrilov2012-09-14 18:49:02 +0400
commit24772f4dbcfcfbf0ac3d29f72d3bda19566d8530 (patch)
treee31e06906af5a071525f69165567ea3fe232c24f /library/LuaApi.cpp
parent68bfc63b7d0804ac5229623480e47f297783f502 (diff)
downloaddfhack-24772f4dbcfcfbf0ac3d29f72d3bda19566d8530.tar.gz
dfhack-24772f4dbcfcfbf0ac3d29f72d3bda19566d8530.tar.bz2
dfhack-24772f4dbcfcfbf0ac3d29f72d3bda19566d8530.tar.xz
Add an api function for destroying items.
Diffstat (limited to 'library/LuaApi.cpp')
-rw-r--r--library/LuaApi.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp
index f69fa7a1..f8497569 100644
--- a/library/LuaApi.cpp
+++ b/library/LuaApi.cpp
@@ -886,6 +886,12 @@ static bool items_moveToInventory
return Items::moveToInventory(mc, item, unit, mode, body_part);
}
+static bool items_remove(df::item *item, bool no_uncat)
+{
+ MapExtras::MapCache mc;
+ return Items::remove(mc, item, no_uncat);
+}
+
static df::proj_itemst *items_makeProjectile(df::item *item)
{
MapExtras::MapCache mc;
@@ -904,6 +910,7 @@ static const LuaWrapper::FunctionReg dfhack_items_module[] = {
WRAPN(moveToBuilding, items_moveToBuilding),
WRAPN(moveToInventory, items_moveToInventory),
WRAPN(makeProjectile, items_makeProjectile),
+ WRAPN(remove, items_remove),
{ NULL, NULL }
};