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

Method clearUnits

library/modules/Burrows.cpp:81–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void Burrows::clearUnits(df::burrow *burrow)
82{
83 CHECK_NULL_POINTER(burrow);
84
85 for (size_t i = 0; i < burrow->units.size(); i++)
86 {
87 auto unit = df::unit::find(burrow->units[i]);
88
89 if (unit) {
90 erase_from_vector(unit->burrows, burrow->id);
91 erase_from_vector(unit->inactive_burrows, burrow->id);
92 }
93 }
94
95 burrow->units.clear();
96}
97
98bool Burrows::isAssignedUnit(df::burrow *burrow, df::unit *unit)
99{

Callers

nothing calls this directly

Calls 4

erase_from_vectorFunction · 0.85
findFunction · 0.50
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected