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

Method riskOfStuckConstructionAt

plugins/suspendmanager.cpp:455–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453 }
454
455 static int riskOfStuckConstructionAt(coord pos) {
456 auto risk = 0;
457 for (auto npos : neighbors | transform(around(pos))) {
458 if (!isSuitableAccess(npos)) { // original used walkable
459 ++risk; // one access blocked, increase danger
460 } else if (!plannedImpassibleAt(npos)) {
461 // walkable neighbour with no plan to build a wall, no danger
462 return -1;
463 }
464 }
465 return risk;
466 }
467
468
469

Callers

nothing calls this directly

Calls 1

aroundFunction · 0.85

Tested by

no test coverage detected