diff --git a/library/lua/dfhack/buildings.lua b/library/lua/dfhack/buildings.lua index ad82da89a..af9ad2605 100644 --- a/library/lua/dfhack/buildings.lua +++ b/library/lua/dfhack/buildings.lua @@ -178,7 +178,20 @@ local building_inputs = { }, [df.building_type.Slab] = { { item_type=df.item_type.SLAB } }, [df.building_type.NestBox] = { { has_tool_use=df.tool_uses.NEST_BOX, item_type=df.item_type.TOOL } }, - [df.building_type.Hive] = { { has_tool_use=df.tool_uses.HIVE, item_type=df.item_type.TOOL } } + [df.building_type.Hive] = { { has_tool_use=df.tool_uses.HIVE, item_type=df.item_type.TOOL } }, + [df.building_type.Rollers] = { + { + name='mechanism', + item_type=df.item_type.TRAPPARTS, + quantity=-1, + vector_id=df.job_item_vector_id.TRAPPARTS + }, + { + name='chain', + item_type=df.item_type.CHAIN, + vector_id=df.job_item_vector_id.CHAIN + } + } } --[[ Furnace building input material table. ]] @@ -318,7 +331,8 @@ local trap_inputs = { item_type=df.item_type.TRAPPARTS, vector_id=df.job_item_vector_id.TRAPPARTS } - } + }, + [df.trap_type.TrackStop] = { { flags2={ building_material=true, non_economic=true } } } } --[[ Functions for lookup in tables. ]] diff --git a/library/modules/Buildings.cpp b/library/modules/Buildings.cpp index 65cf009f3..d2b3e3527 100644 --- a/library/modules/Buildings.cpp +++ b/library/modules/Buildings.cpp @@ -66,6 +66,7 @@ using namespace DFHack; #include "df/building_screw_pumpst.h" #include "df/building_water_wheelst.h" #include "df/building_wellst.h" +#include "df/building_rollersst.h" using namespace df::enums; using df::global::ui; @@ -289,6 +290,10 @@ bool Buildings::getCorrectSize(df::coord2d &size, df::coord2d ¢er, makeOneDim(size, center, direction); return true; + case Rollers: + makeOneDim(size, center, (direction&1) == 0); + return true; + case WaterWheel: size = df::coord2d(3,3); makeOneDim(size, center, direction); @@ -592,6 +597,12 @@ bool Buildings::setSize(df::building *bld, df::coord2d size, int direction) obj->direction = (df::screw_pump_direction)direction; break; } + case Rollers: + { + auto obj = (df::building_rollersst*)bld; + obj->direction = (df::screw_pump_direction)direction; + break; + } case Bridge: { auto obj = (df::building_bridgest*)bld; @@ -881,7 +892,11 @@ bool Buildings::constructWithFilters(df::building *bld, std::vectorquantity < 0) items[i]->quantity = computeMaterialAmount(bld); - job->job_items.push_back(items[i]); + /* The game picks up explicitly listed items in reverse + * order, but processes filters straight. This reverses + * the order of filters so as to produce the same final + * contained_items ordering as the normal ui way. */ + vector_insert_at(job->job_items, 0, items[i]); if (items[i]->item_type == item_type::BOULDER) rough = true; diff --git a/library/xml b/library/xml index 92dbeb626..b0d8e71dc 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 92dbeb6267a24a35babe3d5326801f2e8cfd22e1 +Subproject commit b0d8e71dc9f6e697409bd999801097acdc57fcd8