| 357 | } |
| 358 | |
| 359 | static void copyUnits(df::burrow *target, df::burrow *source, bool enable) { |
| 360 | CHECK_NULL_POINTER(target); |
| 361 | CHECK_NULL_POINTER(source); |
| 362 | |
| 363 | if (source == target) { |
| 364 | if (!enable) |
| 365 | Burrows::clearUnits(target); |
| 366 | return; |
| 367 | } |
| 368 | |
| 369 | for (size_t i = 0; i < source->units.size(); i++) { |
| 370 | if (auto unit = df::unit::find(source->units[i])) |
| 371 | Burrows::setAssignedUnit(target, unit, enable); |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | static int burrow_tiles_clear(lua_State *L) { |
| 376 | color_ostream *out = Lua::GetOutput(L); |
no test coverage detected