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

Method isPotentialSuitableAccess

plugins/suspendmanager.cpp:388–405  ·  view source on GitHub ↗

check if the tile is suitable to stand on and build, or is planned to become one

Source from the content-addressed store, hash-verified

386
387 // check if the tile is suitable to stand on and build, or is planned to become one
388 static bool isPotentialSuitableAccess (coord pos) {
389 if (isSuitableAccess(pos))
390 return true;
391
392 // wall-type tiles can never become suitable
393 auto tile_type = Maps::getTileType(pos);
394 if (!tile_type || isWallTerrain(*tile_type))
395 return false;
396
397 // other tiles can become suitable if a wall is being constructed below
398 auto below = Buildings::findAtTile(coord(pos.x,pos.y,pos.z-1));
399 if (below && below->getType() == df::building_type::Construction &&
400 (below->getSubtype() == construction_type::Wall ||
401 below->getSubtype() == construction_type::ReinforcedWall))
402 return true;
403
404 return false;
405 }
406
407 static bool tileHasSupportWall(coord pos) {
408 auto tile_type = Maps::getTileType(pos);

Callers

nothing calls this directly

Calls 3

getTileTypeFunction · 0.85
isWallTerrainFunction · 0.85
getTypeMethod · 0.80

Tested by

no test coverage detected