Support building steam engines on top of brooks without any down stairs.

develop
Alexander Gavrilov 2012-11-10 17:33:05 +04:00
parent eb936c4ce0
commit 56ef33ea0e
3 changed files with 12 additions and 4 deletions

@ -203,6 +203,12 @@ namespace DFHack
return ENUM_ATTR(tiletype_shape, passable_flow, tileShape(tiletype)); return ENUM_ATTR(tiletype_shape, passable_flow, tileShape(tiletype));
} }
inline
bool FlowPassableDown(df::tiletype tiletype)
{
return ENUM_ATTR(tiletype_shape, passable_flow_down, tileShape(tiletype));
}
inline inline
bool isWalkable(df::tiletype tiletype) bool isWalkable(df::tiletype tiletype)
{ {

@ -1 +1 @@
Subproject commit 02e0e0d7b9a7ef708a621ef5511a24bf8657b4a2 Subproject commit 4b2124957e282683480eaf05922e63c353364ec1

@ -320,7 +320,7 @@ struct workshop_hook : df::building_workshopst {
for (int y = y1; y <= y2; y++) for (int y = y1; y <= y2; y++)
{ {
auto ptile = Maps::getTileType(x,y,z); auto ptile = Maps::getTileType(x,y,z);
if (!ptile || !LowPassable(*ptile)) if (!ptile || !FlowPassableDown(*ptile))
continue; continue;
auto pltile = Maps::getTileType(x,y,z-1); auto pltile = Maps::getTileType(x,y,z-1);
@ -891,7 +891,7 @@ IMPLEMENT_VMETHOD_INTERPOSE(dwarfmode_hook, feed);
* Scan raws for matching workshop buildings. * Scan raws for matching workshop buildings.
*/ */
static bool find_engines() static bool find_engines(color_ostream &out)
{ {
engines.clear(); engines.clear();
@ -943,6 +943,8 @@ static bool find_engines()
if (!ws.gear_tiles.empty()) if (!ws.gear_tiles.empty())
engines.push_back(ws); engines.push_back(ws);
else
out.printerr("%s has no gear tiles - ignoring.\n", wslist[i]->code.c_str());
} }
return !engines.empty(); return !engines.empty();
@ -973,7 +975,7 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan
{ {
switch (event) { switch (event) {
case SC_WORLD_LOADED: case SC_WORLD_LOADED:
if (find_engines()) if (find_engines(out))
{ {
out.print("Detected steam engine workshops - enabling plugin.\n"); out.print("Detected steam engine workshops - enabling plugin.\n");
enable_hooks(true); enable_hooks(true);