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

Function clear_reservation

plugins/preserve-rooms.cpp:378–389  ·  view source on GitHub ↗

clear the reservation for a zone

Source from the content-addressed store, hash-verified

376
377// clear the reservation for a zone
378static void clear_reservation(color_ostream &out, int32_t zone_id, df::building_civzonest * zone = NULL) {
379 auto it = reserved_zones.find(zone_id);
380 if (it == reserved_zones.end())
381 return;
382 for (int32_t hfid : it->second)
383 scrub_id_from_entries(zone_id, hfid, pending_reassignment);
384 reserved_zones.erase(zone_id);
385 if (!zone)
386 zone = virtual_cast<df::building_civzonest>(df::building::find(zone_id));
387 if (zone)
388 zone->spec_sub_flag.bits.active = true;
389}
390
391// stop reserving zones for dead units or units that are no longer in an army
392static void scrub_reservations(color_ostream &out) {

Calls 5

scrub_id_from_entriesFunction · 0.85
findFunction · 0.50
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected