change `unitst::owned_buildings` to `vector<building_civzonest*>`

actually simplifies things lol
develop
Kelly Kinkade 2023-11-27 20:38:35 -06:00
parent b6a49fb5a5
commit ea6903862b
2 changed files with 4 additions and 6 deletions

@ -357,17 +357,15 @@ bool Buildings::setOwner(df::building_civzonest *bld, df::unit *unit)
if (bld->assigned_unit == unit)
return true;
df::building * pbld = virtual_cast<df::building>(bld);
if (bld->assigned_unit)
{
auto &blist = bld->assigned_unit->owned_buildings;
vector_erase_at(blist, linear_index(blist, pbld));
vector_erase_at(blist, linear_index(blist, bld));
if (auto spouse = df::unit::find(bld->assigned_unit->relationship_ids[df::unit_relationship_type::Spouse]))
{
auto &blist = spouse->owned_buildings;
vector_erase_at(blist, linear_index(blist, pbld));
vector_erase_at(blist, linear_index(blist, bld));
}
}
@ -381,7 +379,7 @@ bool Buildings::setOwner(df::building_civzonest *bld, df::unit *unit)
if (auto spouse = df::unit::find(unit->relationship_ids[df::unit_relationship_type::Spouse]))
{
auto &blist = spouse->owned_buildings;
if (bld->canUseSpouseRoom() && linear_index(blist, pbld) < 0)
if (bld->canUseSpouseRoom() && linear_index(blist, bld) < 0)
blist.push_back(bld);
}
}

@ -1 +1 @@
Subproject commit 6d246b716bbaf7de5ff9633293a859732c741d8c
Subproject commit ab028aa9fe8c75eb56c5e1a80cbd14d2a897bfc4