|
|
@ -712,13 +712,20 @@ static bool hasValidMapPos(df::unit *unit) {
|
|
|
|
&& unit->pos.z < world->map.z_count;
|
|
|
|
&& unit->pos.z < world->map.z_count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// built cage defined as room (supposed to detect zoo cages)
|
|
|
|
// built cage in a zone (supposed to detect zoo cages)
|
|
|
|
static bool isInBuiltCageRoom(df::unit *unit) {
|
|
|
|
static bool isInBuiltCageRoom(df::unit *unit) {
|
|
|
|
for (auto building : world->buildings.all) {
|
|
|
|
for (auto building : world->buildings.all) {
|
|
|
|
// !!! building->isRoom() returns true if the building can be made a room but currently isn't
|
|
|
|
if (building->getType() != df::building_type::Cage)
|
|
|
|
// !!! except for coffins/tombs which always return false
|
|
|
|
continue;
|
|
|
|
// !!! using the bool is_room however gives the correct state/value
|
|
|
|
|
|
|
|
if (!building->is_room || building->getType() != df::building_type::Cage)
|
|
|
|
bool in_zone = false;
|
|
|
|
|
|
|
|
for (auto relation : building->relations) {
|
|
|
|
|
|
|
|
if (relation->getType() == df::building_type::Civzone) {
|
|
|
|
|
|
|
|
in_zone = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!in_zone)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
df::building_cagest* cage = (df::building_cagest*)building;
|
|
|
|
df::building_cagest* cage = (df::building_cagest*)building;
|
|
|
|