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

Method findCivzonesAt

library/modules/Buildings.cpp:435–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435bool Buildings::findCivzonesAt(std::vector<df::building_civzonest*> *pvec,
436 df::coord pos) {
437 pvec->clear();
438
439 for (df::building_civzonest* zone : world->buildings.other.ANY_ZONE)
440 {
441 if (pos.z != zone->z)
442 continue;
443
444 if (zone->room.extents && zone->isExtentShaped())
445 {
446 auto etile = getExtentTile(zone->room, pos);
447 if (!etile || !*etile)
448 continue;
449
450 pvec->push_back(zone);
451 }
452 }
453
454 return !pvec->empty();
455}
456
457df::building *Buildings::allocInstance(df::coord pos, df::building_type type, int subtype, int custom)
458{

Callers

nothing calls this directly

Calls 3

getExtentTileFunction · 0.85
clearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected