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

Function box_fill

plugins/burrow.cpp:439–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439static void box_fill(lua_State *L, bool enable) {
440 df::burrow *burrow = get_burrow(L, 1);
441 if (!burrow) {
442 luaL_argerror(L, 1, "invalid burrow specifier or burrow not found");
443 return;
444 }
445
446 df::coord pos_start, pos_end;
447 if (!get_bounds(L, 2, pos_start, pos_end)) {
448 luaL_argerror(L, 2, "invalid box bounds");
449 return;
450 }
451
452 for (int32_t z = pos_start.z; z <= pos_end.z; ++z) {
453 for (int32_t y = pos_start.y; y <= pos_end.y; ++y) {
454 for (int32_t x = pos_start.x; x <= pos_end.x; ++x) {
455 df::coord pos(x, y, z);
456 Burrows::setAssignedTile(burrow, pos, enable);
457 }
458 }
459 }
460}
461
462static int burrow_tiles_box_add(lua_State *L) {
463 color_ostream *out = Lua::GetOutput(L);

Callers 2

burrow_tiles_box_addFunction · 0.85
burrow_tiles_box_removeFunction · 0.85

Calls 4

get_burrowFunction · 0.85
luaL_argerrorFunction · 0.85
setAssignedTileFunction · 0.85
get_boundsFunction · 0.70

Tested by

no test coverage detected