built cage in a zone (supposed to detect zoo cages)
| 633 | |
| 634 | // built cage in a zone (supposed to detect zoo cages) |
| 635 | static bool isInBuiltCageRoom(df::unit *unit) { |
| 636 | for (auto building : world->buildings.all) { |
| 637 | if (building->getType() != df::building_type::Cage) |
| 638 | continue; |
| 639 | |
| 640 | if (!building->relations.size()) |
| 641 | continue; |
| 642 | |
| 643 | df::building_cagest* cage = (df::building_cagest*)building; |
| 644 | for (auto cu : cage->assigned_units) |
| 645 | if (cu == unit->id) return true; |
| 646 | } |
| 647 | return false; |
| 648 | } |
| 649 | |
| 650 | // This can be used to identify completely inappropriate units (dead, undead, not belonging to the fort, ...) |
| 651 | // that autobutcher should be ignoring. |
no test coverage detected