Hooks
static bool BeforeCvGlobals_getXYCityPlot(CvGlobals* self, int i, int j, int& result);static void AfterCvGlobals_getXYCityPlot(CvGlobals* self, int i, int j, int& result);static int ReplaceCvGlobals_getXYCityPlot(int (*original)(CvGlobals*, int, int), CvGlobals* self, int i, int j);CivRegisterBefore<CivHooks::CvGlobals_getXYCityPlot>(host, &BeforeCvGlobals_getXYCityPlot);CivRegisterAfter<CivHooks::CvGlobals_getXYCityPlot>(host, &AfterCvGlobals_getXYCityPlot);CivRegisterReplace<CivHooks::CvGlobals_getXYCityPlot>(host, &ReplaceCvGlobals_getXYCityPlot);
Code
2564int CvGlobals::getXYCityPlot(int i, int j)2565{2566#if defined(MOD_GLOBAL_CITY_WORKING)2567 CvAssertMsg(i < (2*MAX_CITY_RADIUS+1), "Index out of bounds");2568 CvAssertMsg(i > -1, "Index out of bounds");2569 if(i < 0 || i >= (2*MAX_CITY_RADIUS+1)) return -1;25702571 CvAssertMsg(j < (2*MAX_CITY_RADIUS+1), "Index out of bounds");2572 CvAssertMsg(j > -1, "Index out of bounds");2573 if(j < 0 || j >= (2*MAX_CITY_RADIUS+1)) return -1;2574#else2575 CvAssertMsg(i < CITY_PLOTS_DIAMETER, "Index out of bounds");2576 CvAssertMsg(i > -1, "Index out of bounds");2577 if(i < 0 || i >= CITY_PLOTS_DIAMETER) return -1;25782579 CvAssertMsg(j < CITY_PLOTS_DIAMETER, "Index out of bounds");2580 CvAssertMsg(j > -1, "Index out of bounds");2581 if(j < 0 || j >= CITY_PLOTS_DIAMETER) return -1;2582#endif25832584 return m_aaiXYCityPlot[i][j];2585}