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

Method setAssignedUnit

library/modules/Burrows.cpp:107–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void Burrows::setAssignedUnit(df::burrow *burrow, df::unit *unit, bool enable)
108{
109 CHECK_NULL_POINTER(unit);
110 CHECK_NULL_POINTER(burrow);
111
112 if (enable) {
113 if (burrow->flags.bits.suspended)
114 insert_into_vector(unit->inactive_burrows, burrow->id);
115 else
116 insert_into_vector(unit->burrows, burrow->id);
117 insert_into_vector(burrow->units, unit->id);
118 } else {
119 erase_from_vector(unit->burrows, burrow->id);
120 erase_from_vector(unit->inactive_burrows, burrow->id);
121 erase_from_vector(burrow->units, unit->id);
122 }
123}
124
125void Burrows::listBlocks(std::vector<df::map_block*> *pvec, df::burrow *burrow)
126{

Callers

nothing calls this directly

Calls 2

insert_into_vectorFunction · 0.85
erase_from_vectorFunction · 0.85

Tested by

no test coverage detected