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

Function remove_zone_from_all_buildings

library/modules/Buildings.cpp:264–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264static void remove_zone_from_all_buildings(df::building* zone_as_building)
265{
266 if (zone_as_building->getType() != df::building_type::Civzone)
267 return;
268
269 auto zone = strict_virtual_cast<df::building_civzonest>(zone_as_building);
270
271 if (zone == nullptr)
272 return;
273
274 // this is a paranoid check and slower than it could be. Zones contain a list of children
275 // good for fixing potentially bad game states when deleting a zone
276 for (auto bld : world->buildings.other.IN_PLAY)
277 remove_building_from_zone(bld, zone);
278}
279
280uint32_t Buildings::getNumBuildings()
281{

Callers 2

on_civzone_deleteFunction · 0.85
notifyCivzoneModifiedMethod · 0.85

Calls 2

getTypeMethod · 0.80

Tested by

no test coverage detected