CvCity::HasAnyNaturalWonder() const
- Defined in
- CvCity.cpp, line 17261
- Class
- CvCity
- Hook name
CivHooks::CvCity_HasAnyNaturalWonder
Hooks
static bool BeforeCvCity_HasAnyNaturalWonder(const CvCity* self, bool& result);static void AfterCvCity_HasAnyNaturalWonder(const CvCity* self, bool& result);static bool ReplaceCvCity_HasAnyNaturalWonder(bool (*original)(const CvCity*), const CvCity* self);CivRegisterBefore<CivHooks::CvCity_HasAnyNaturalWonder>(host, &BeforeCvCity_HasAnyNaturalWonder);CivRegisterAfter<CivHooks::CvCity_HasAnyNaturalWonder>(host, &AfterCvCity_HasAnyNaturalWonder);CivRegisterReplace<CivHooks::CvCity_HasAnyNaturalWonder>(host, &ReplaceCvCity_HasAnyNaturalWonder);
Code
17261bool CvCity::HasAnyNaturalWonder() const17262{17263 int iX = getX(); int iY = getY(); int iOwner = getOwner();1726417265#if defined(MOD_GLOBAL_CITY_WORKING)17266 for (int iCityPlotLoop = 0; iCityPlotLoop < GetNumWorkablePlots(); iCityPlotLoop++)17267#else17268 for (int iCityPlotLoop = 0; iCityPlotLoop < NUM_CITY_PLOTS; iCityPlotLoop++)17269#endif17270 {17271 CvPlot* pLoopPlot = plotCity(iX, iY, iCityPlotLoop);1727217273 // Invalid plot or not owned by this player17274 if (pLoopPlot == NULL || pLoopPlot->getOwner() != iOwner) {17275 continue;17276 }1727717278 if (pLoopPlot->IsNaturalWonder()) {17279 return true;17280 }17281 }1728217283 return false;17284}