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

Function is_accessible_item

plugins/autochop.cpp:223–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221//
222
223static bool is_accessible_item(df::item *item, const vector<df::unit *> &citizens) {
224 const df::coord pos = Items::getPosition(item);
225 for (auto &unit : citizens) {
226 if (Maps::canWalkBetween(Units::getPosition(unit), pos))
227 return true;
228 }
229 return false;
230}
231
232// at least one member of the fort can reach a position adjacent to the given pos
233static bool is_accessible_tree(const df::coord &pos, const vector<df::unit *> &citizens) {

Callers 1

scan_logsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected