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

Function simulate_area_fall

plugins/channel-safely/channel-safely-plugin.cpp:133–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133df::coord simulate_area_fall(const df::coord &pos) {
134 df::coord neighbours[8]{};
135 get_neighbours(pos, neighbours);
136 df::coord lowest = simulate_fall(pos);
137 for (auto p : neighbours) {
138 if unlikely(!Maps::isValidTilePos(p)) continue;
139 auto nlow = simulate_fall(p);
140 if (nlow.z < lowest.z) {
141 lowest = nlow;
142 }
143 }
144 return lowest;
145}
146
147namespace CSP {
148 std::unordered_map<df::unit*, int32_t> endangered_units;

Callers 1

NewReportEventFunction · 0.85

Calls 3

get_neighboursFunction · 0.85
isValidTilePosFunction · 0.85
simulate_fallFunction · 0.70

Tested by

no test coverage detected