Bazaar developer reference

CvUnit::GetGarrisonedCity()

Defined in
CvUnit.cpp, line 17534
Class
CvUnit
Hook name
CivHooks::CvUnit_GetGarrisonedCity

Hooks

static bool BeforeCvUnit_GetGarrisonedCity(CvUnit* self, CvCity*& result);static void AfterCvUnit_GetGarrisonedCity(CvUnit* self, CvCity*& result);static CvCity* ReplaceCvUnit_GetGarrisonedCity(CvCity* (*original)(CvUnit*), CvUnit* self);CivRegisterBefore<CivHooks::CvUnit_GetGarrisonedCity>(host, &BeforeCvUnit_GetGarrisonedCity);CivRegisterAfter<CivHooks::CvUnit_GetGarrisonedCity>(host, &AfterCvUnit_GetGarrisonedCity);CivRegisterReplace<CivHooks::CvUnit_GetGarrisonedCity>(host, &ReplaceCvUnit_GetGarrisonedCity);

Code

17534CvCity* CvUnit::GetGarrisonedCity()17535{17536	if(IsGarrisoned())17537	{17538		CvPlot* pPlot = plot();17539		if(pPlot)17540		{17541			CvCity* pCity = pPlot->getPlotCity();17542			if(pCity)17543			{17544				return pCity;17545			}17546		}17547	}1754817549	return NULL;17550}

Calls

Called by