use newly narrowd relations vector

develop
Myk Taylor 2023-01-20 14:30:48 -08:00
parent 15ba54eea9
commit acf2b8b319
No known key found for this signature in database
2 changed files with 3 additions and 9 deletions

@ -1 +1 @@
Subproject commit 5d43fd9fd91007cf674bfde44b2c5a0ac70170db
Subproject commit 7c396a2e9df433bb4904e7d7eb0f46c80b48c721

@ -10,6 +10,7 @@
#include <vector>
#include "df/building_cagest.h"
#include "df/building_civzonest.h"
#include "df/creature_raw.h"
#include "df/world.h"
@ -718,14 +719,7 @@ static bool isInBuiltCageRoom(df::unit *unit) {
if (building->getType() != df::building_type::Cage)
continue;
bool in_zone = false;
for (auto relation : building->relations) {
if (relation->getType() == df::building_type::Civzone) {
in_zone = true;
break;
}
}
if (!in_zone)
if (!building->relations.size())
continue;
df::building_cagest* cage = (df::building_cagest*)building;