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

Function copyUnits

plugins/burrow.cpp:359–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359static 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
375static int burrow_tiles_clear(lua_State *L) {
376 color_ostream *out = Lua::GetOutput(L);

Callers 1

units_set_add_removeFunction · 0.85

Calls 2

findFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected