| 262 | } |
| 263 | |
| 264 | static 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 | |
| 280 | uint32_t Buildings::getNumBuildings() |
| 281 | { |
no test coverage detected