Skip to content

Commit

Permalink
Improvement to settlement building setting for GSM provinces
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed May 28, 2016
1 parent 502a833 commit 9cb1520
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/stratagus/grand_strategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2743,6 +2743,13 @@ void CGrandStrategyProvince::SetSettlementBuilding(int building_id, bool has_set
return;
}

//if this province has an equivalent building for its civilization/faction, use that instead
if (!UnitTypes[building_id]->Civilization.empty()) {
if (this->GetClassUnitType(GetUnitTypeClassIndexByName(UnitTypes[building_id]->Class)) != building_id && this->GetClassUnitType(GetUnitTypeClassIndexByName(UnitTypes[building_id]->Class)) != -1) {
building_id = this->GetClassUnitType(GetUnitTypeClassIndexByName(UnitTypes[building_id]->Class));
}
}

if (this->SettlementBuildings[building_id] == has_settlement_building) {
return;
}
Expand Down

0 comments on commit 9cb1520

Please sign in to comment.