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

Function expand_burrows

plugins/burrow.cpp:161–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161static void expand_burrows(color_ostream &out, const df::coord & pos, df::tiletype prev_tt, df::tiletype tt) {
162 if (!isWalkable(tt) && tileShape(tt) != tiletype_shape::RAMP_TOP)
163 return;
164
165 bool changed = false;
166 for (auto b : plotinfo->burrows.list) {
167 if (!b->name.ends_with('+') || !Burrows::isAssignedTile(b, pos))
168 continue;
169
170 if (!isWalkable(prev_tt)) {
171 changed = true;
172 add_walls_to_burrow(out, b, pos+df::coord(-1,-1,0), pos+df::coord(1,1,0));
173
174 if (isWalkableUp(tt))
175 Burrows::setAssignedTile(b, pos+df::coord(0,0,1), true);
176
177 if (tileShape(tt) == tiletype_shape::RAMP)
178 add_walls_to_burrow(out, b, pos+df::coord(-1,-1,1), pos+df::coord(1,1,1));
179 }
180
181 if (LowPassable(tt) && !LowPassable(prev_tt)) {
182 changed = true;
183 Burrows::setAssignedTile(b, pos-df::coord(0,0,1), true);
184 if (tileShape(tt) == tiletype_shape::RAMP_TOP)
185 add_walls_to_burrow(out, b, pos+df::coord(-1,-1,-1), pos+df::coord(1,1,-1));
186 }
187 }
188
189 if (changed)
190 Job::checkDesignationsNow();
191}
192
193static void jobCompletedHandler(color_ostream& out, void* ptr) {
194 DEBUG(event, out).print("entering jobCompletedHandler\n");

Callers 1

jobCompletedHandlerFunction · 0.85

Calls 7

isWalkableFunction · 0.85
tileShapeFunction · 0.85
isAssignedTileFunction · 0.85
add_walls_to_burrowFunction · 0.85
isWalkableUpFunction · 0.85
setAssignedTileFunction · 0.85
LowPassableFunction · 0.85

Tested by

no test coverage detected