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

Method clearTiles

library/modules/Burrows.cpp:158–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void Burrows::clearTiles(df::burrow *burrow)
159{
160 CHECK_NULL_POINTER(burrow);
161
162 df::coord base(world->map.region_x*3,world->map.region_y*3,world->map.region_z);
163
164 for (size_t i = 0; i < burrow->block_x.size(); i++)
165 {
166 df::coord pos(burrow->block_x[i], burrow->block_y[i], burrow->block_z[i]);
167
168 auto block = Maps::getBlock(pos - base);
169 if (!block)
170 continue;
171
172 destroyBurrowMask(getBlockMask(burrow, block));
173 }
174
175 burrow->block_x.clear();
176 burrow->block_y.clear();
177 burrow->block_z.clear();
178}
179
180df::block_burrow *Burrows::getBlockMask(df::burrow *burrow, df::map_block *block, bool create)
181{

Callers

nothing calls this directly

Calls 4

getBlockFunction · 0.85
destroyBurrowMaskFunction · 0.85
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected