| 437 | } |
| 438 | |
| 439 | static 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 | |
| 462 | static int burrow_tiles_box_add(lua_State *L) { |
| 463 | color_ostream *out = Lua::GetOutput(L); |
no test coverage detected