MCPcopy Create free account
hub / github.com/DFHack/dfhack / check_hanging_tiles

Method check_hanging_tiles

plugins/steam-engine.cpp:761–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759 }
760
761 void check_hanging_tiles(steam_engine_workshop *engine)
762 {
763 if (!engine) return;
764
765 bool error = false;
766
767 int x1 = cursor->x - engine->def->workloc_x;
768 int y1 = cursor->y - engine->def->workloc_y;
769
770 for (int x = 0; x < engine->def->dim_x; x++)
771 {
772 for (int y = 0; y < engine->def->dim_y; y++)
773 {
774 if (ui_build_selector->tiles[x][y] >= 5)
775 continue;
776
777 auto ptile = Maps::getTileType(x1+x,y1+y,cursor->z);
778 if (ptile && !isOpenTerrain(*ptile))
779 continue;
780
781 ui_build_selector->tiles[x][y] = 6;
782 error = true;
783 }
784 }
785
786 if (error)
787 {
788 const char *msg = "Hanging - cover channels with down stairs.";
789 ui_build_selector->errors.push_back(new std::string(msg));
790 }
791 }
792
793 DEFINE_VMETHOD_INTERPOSE(void, feed, (set<df::interface_key> *input))
794 {

Callers

nothing calls this directly

Calls 2

getTileTypeFunction · 0.85
isOpenTerrainFunction · 0.85

Tested by

no test coverage detected