diff --git a/CvGameCoreDLL_Expansion2/CvPlot.cpp b/CvGameCoreDLL_Expansion2/CvPlot.cpp index c8284941fd..2e71c08d86 100644 --- a/CvGameCoreDLL_Expansion2/CvPlot.cpp +++ b/CvGameCoreDLL_Expansion2/CvPlot.cpp @@ -5884,7 +5884,7 @@ int CvPlot::ComputeYieldFromAdjacentImprovement(CvImprovementEntry& kImprovement for(int iI = 0; iI < NUM_DIRECTION_TYPES; iI++) { pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI)); - if(pAdjacentPlot && pAdjacentPlot->getImprovementType() == eValue) + if(pAdjacentPlot && pAdjacentPlot->getImprovementType() == eValue && !pAdjacentPlot->IsImprovementPillaged()) { iRtnValue += kImprovement.GetYieldAdjacentSameType(eYield); } @@ -5904,7 +5904,7 @@ int CvPlot::ComputeYieldFromTwoAdjacentImprovement(CvImprovementEntry& kImprovem for(int iI = 0; iI < NUM_DIRECTION_TYPES; iI++) { pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI)); - if(pAdjacentPlot && pAdjacentPlot->getImprovementType() == eValue) + if(pAdjacentPlot && pAdjacentPlot->getImprovementType() == eValue && !pAdjacentPlot->IsImprovementPillaged()) { iRtnValue += kImprovement.GetYieldAdjacentTwoSameType(eYield); } @@ -5920,21 +5920,15 @@ int CvPlot::ComputeYieldFromOtherAdjacentImprovement(CvImprovementEntry& kImprov CvPlot* pAdjacentPlot = NULL; int iRtnValue = 0; - for(int iJ = 0; iJ < GC.getNumImprovementInfos(); iJ++) + for(int iI = 0; iI < NUM_DIRECTION_TYPES; iI++) { - ImprovementTypes eImprovement = (ImprovementTypes)iJ; - if(eImprovement != NO_IMPROVEMENT) + pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI)); + if(pAdjacentPlot && pAdjacentPlot->getImprovementType() != NO_IMPROVEMENT && !pAdjacentPlot->IsImprovementPillaged()) { - if(kImprovement.GetAdjacentImprovementYieldChanges(eImprovement, eYield) > 0) + int iChange = kImprovement.GetAdjacentImprovementYieldChanges(pAdjacentPlot->getImprovementType(), eYield); + if (iChange > 0) { - for(int iI = 0; iI < NUM_DIRECTION_TYPES; iI++) - { - pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI)); - if(pAdjacentPlot && pAdjacentPlot->getImprovementType() == eImprovement) - { - iRtnValue += kImprovement.GetAdjacentImprovementYieldChanges(eImprovement, eYield); - } - } + iRtnValue += iChange; } } }