Skip to content

Commit

Permalink
Potential fix to the CUnit::UpdateSettlement recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Jun 4, 2018
1 parent cc8b309 commit c2b6412
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unit/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3343,7 +3343,7 @@ void CUnit::UpdateBuildingSettlementAssignment(CSettlement *old_settlement)
}
for (int i = 0; i < Players[p].GetUnitCount(); ++i) {
CUnit *settlement_unit = &Players[p].GetUnit(i);
if (!settlement_unit || !settlement_unit->IsAliveOnMap() || !settlement_unit->Type->BoolFlag[BUILDING_INDEX].value || settlement_unit->Type->BoolFlag[TOWNHALL_INDEX].value || this->MapLayer != settlement_unit->MapLayer) {
if (!settlement_unit || !settlement_unit->IsAliveOnMap() || !settlement_unit->Type->BoolFlag[BUILDING_INDEX].value || settlement_unit->Type->BoolFlag[TOWNHALL_INDEX].value || settlement_unit->Type == SettlementSiteUnitType || this->MapLayer != settlement_unit->MapLayer) {
continue;
}
if (old_settlement && settlement_unit->Settlement != old_settlement) {
Expand Down

0 comments on commit c2b6412

Please sign in to comment.