diff options
| author | Alexander Gavrilov | 2012-09-12 18:17:42 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-09-12 18:17:42 +0400 |
| commit | 7c71aeab5f44c7fce106a0efc07c1ea2860e4638 (patch) | |
| tree | db2c792ddd19b323c7a8156435f7c3daaea54a98 /library/LuaApi.cpp | |
| parent | 448d7e3633efd5171feaa3c3a0cdc4afbfafe105 (diff) | |
| download | dfhack-7c71aeab5f44c7fce106a0efc07c1ea2860e4638.tar.gz dfhack-7c71aeab5f44c7fce106a0efc07c1ea2860e4638.tar.bz2 dfhack-7c71aeab5f44c7fce106a0efc07c1ea2860e4638.tar.xz | |
Add function for making item projectiles.
Diffstat (limited to 'library/LuaApi.cpp')
| -rw-r--r-- | library/LuaApi.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index d39a945d..f69fa7a1 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -80,6 +80,7 @@ distribution. #include "df/region_map_entry.h" #include "df/flow_info.h" #include "df/unit_misc_trait.h" +#include "df/proj_itemst.h" #include <lua.h> #include <lauxlib.h> @@ -885,6 +886,12 @@ static bool items_moveToInventory return Items::moveToInventory(mc, item, unit, mode, body_part); } +static df::proj_itemst *items_makeProjectile(df::item *item) +{ + MapExtras::MapCache mc; + return Items::makeProjectile(mc, item); +} + static const LuaWrapper::FunctionReg dfhack_items_module[] = { WRAPM(Items, getGeneralRef), WRAPM(Items, getSpecificRef), @@ -896,6 +903,7 @@ static const LuaWrapper::FunctionReg dfhack_items_module[] = { WRAPN(moveToContainer, items_moveToContainer), WRAPN(moveToBuilding, items_moveToBuilding), WRAPN(moveToInventory, items_moveToInventory), + WRAPN(makeProjectile, items_makeProjectile), { NULL, NULL } }; |
