From c2b6412a6ae43d485de7fc615aca9e14e8365b4f Mon Sep 17 00:00:00 2001 From: Andrettin Date: Mon, 4 Jun 2018 18:16:18 +0200 Subject: [PATCH] Potential fix to the CUnit::UpdateSettlement recursion --- src/unit/unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index c24e9a61e..860e9f735 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -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) {