|
|
@ -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);
|
|
|
|