|
|
@ -627,6 +627,7 @@ static const luaL_Reg dfhack_job_funcs[] = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const LuaWrapper::FunctionReg dfhack_units_module[] = {
|
|
|
|
static const LuaWrapper::FunctionReg dfhack_units_module[] = {
|
|
|
|
|
|
|
|
WRAPM(Units, getContainer),
|
|
|
|
WRAPM(Units, setNickname),
|
|
|
|
WRAPM(Units, setNickname),
|
|
|
|
WRAPM(Units, getVisibleName),
|
|
|
|
WRAPM(Units, getVisibleName),
|
|
|
|
WRAPM(Units, getNemesis),
|
|
|
|
WRAPM(Units, getNemesis),
|
|
|
@ -638,6 +639,16 @@ static const LuaWrapper::FunctionReg dfhack_units_module[] = {
|
|
|
|
{ NULL, NULL }
|
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int units_getPosition(lua_State *state)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return push_pos(state, Units::getPosition(get_checked_arg<df::unit>(state,1)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const luaL_Reg dfhack_units_funcs[] = {
|
|
|
|
|
|
|
|
{ "getPosition", units_getPosition },
|
|
|
|
|
|
|
|
{ NULL, NULL }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static bool items_moveToGround(df::item *item, df::coord pos)
|
|
|
|
static bool items_moveToGround(df::item *item, df::coord pos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MapExtras::MapCache mc;
|
|
|
|
MapExtras::MapCache mc;
|
|
|
@ -729,7 +740,7 @@ void OpenDFHackApi(lua_State *state)
|
|
|
|
LuaWrapper::SetFunctionWrappers(state, dfhack_module);
|
|
|
|
LuaWrapper::SetFunctionWrappers(state, dfhack_module);
|
|
|
|
OpenModule(state, "gui", dfhack_gui_module);
|
|
|
|
OpenModule(state, "gui", dfhack_gui_module);
|
|
|
|
OpenModule(state, "job", dfhack_job_module, dfhack_job_funcs);
|
|
|
|
OpenModule(state, "job", dfhack_job_module, dfhack_job_funcs);
|
|
|
|
OpenModule(state, "units", dfhack_units_module);
|
|
|
|
OpenModule(state, "units", dfhack_units_module, dfhack_units_funcs);
|
|
|
|
OpenModule(state, "items", dfhack_items_module, dfhack_items_funcs);
|
|
|
|
OpenModule(state, "items", dfhack_items_module, dfhack_items_funcs);
|
|
|
|
OpenModule(state, "maps", dfhack_maps_module, dfhack_maps_funcs);
|
|
|
|
OpenModule(state, "maps", dfhack_maps_module, dfhack_maps_funcs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|