diff --git a/CvGameCoreDLL_Expansion2/CvPlot.cpp b/CvGameCoreDLL_Expansion2/CvPlot.cpp index f07d17817b..c8284941fd 100644 --- a/CvGameCoreDLL_Expansion2/CvPlot.cpp +++ b/CvGameCoreDLL_Expansion2/CvPlot.cpp @@ -3352,14 +3352,19 @@ int CvPlot::getFeatureProduction(BuildTypes eBuild, PlayerTypes ePlayer, CvCity* return 0; } - *ppCity = getEffectiveOwningCity(); + CvCity* pEffectiveOwningCity = getEffectiveOwningCity(); - if(*ppCity == NULL) + if(pEffectiveOwningCity == NULL) { - *ppCity = GC.getMap().findCity(getX(), getY(), NO_PLAYER, eTeam, false); + pEffectiveOwningCity = GC.getMap().findCity(getX(), getY(), NO_PLAYER, eTeam, false); } - if(*ppCity == NULL) + if (ppCity) + { + *ppCity = pEffectiveOwningCity; + } + + if(pEffectiveOwningCity == NULL) { return 0; }