Bazaar developer reference

CvCityConnections::GetCityFromIndex(int)

Defined in
CvCityConnections.cpp, line 555
Class
CvCityConnections
Hook name
CivHooks::CvCityConnections_GetCityFromIndex

Hooks

static bool BeforeCvCityConnections_GetCityFromIndex(CvCityConnections* self, int iIndex, CvCity*& result);static void AfterCvCityConnections_GetCityFromIndex(CvCityConnections* self, int iIndex, CvCity*& result);static CvCity* ReplaceCvCityConnections_GetCityFromIndex(CvCity* (*original)(CvCityConnections*, int), CvCityConnections* self, int iIndex);CivRegisterBefore<CivHooks::CvCityConnections_GetCityFromIndex>(host, &BeforeCvCityConnections_GetCityFromIndex);CivRegisterAfter<CivHooks::CvCityConnections_GetCityFromIndex>(host, &AfterCvCityConnections_GetCityFromIndex);CivRegisterReplace<CivHooks::CvCityConnections_GetCityFromIndex>(host, &ReplaceCvCityConnections_GetCityFromIndex);

Code

555CvCity* CvCityConnections::GetCityFromIndex(int iIndex)556{557	int iPlotIndex = m_aiCityPlotIDs[iIndex];558	CvPlot* pPlot = GC.getMap().plotByIndex(iPlotIndex);559	CvAssertMsg(pPlot, "invalid plot. whut??");560561	if(!pPlot) return 0;562563	CvCity* pCity = pPlot->getPlotCity();564	CvAssertMsg(pCity, "No city on this plot. Whut?");565566	return pCity;567}

Calls

Called by