Bazaar developer reference

CvCity::setUnitProductionTimes100(UnitTypes, int)

Defined in
CvCity.cpp, line 11560
Class
CvCity
Hook name
CivHooks::CvCity_setUnitProductionTimes100

Hooks

static bool BeforeCvCity_setUnitProductionTimes100(CvCity* self, UnitTypes eIndex, int iNewValue);static void AfterCvCity_setUnitProductionTimes100(CvCity* self, UnitTypes eIndex, int iNewValue);static void ReplaceCvCity_setUnitProductionTimes100(void (*original)(CvCity*, UnitTypes, int), CvCity* self, UnitTypes eIndex, int iNewValue);CivRegisterBefore<CivHooks::CvCity_setUnitProductionTimes100>(host, &BeforeCvCity_setUnitProductionTimes100);CivRegisterAfter<CivHooks::CvCity_setUnitProductionTimes100>(host, &AfterCvCity_setUnitProductionTimes100);CivRegisterReplace<CivHooks::CvCity_setUnitProductionTimes100>(host, &ReplaceCvCity_setUnitProductionTimes100);

Code

11560void CvCity::setUnitProductionTimes100(UnitTypes eIndex, int iNewValue)11561{11562	VALIDATE_OBJECT11563	CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");11564	CvAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()");1156511566	if(getUnitProductionTimes100(eIndex) != iNewValue)11567	{11568		m_paiUnitProduction.setAt(eIndex, iNewValue);11569		CvAssert(getUnitProductionTimes100(eIndex) >= 0);1157011571		if((getOwner() == GC.getGame().getActivePlayer()) && isCitySelected())11572		{11573			DLLUI->setDirty(CityScreen_DIRTY_BIT, true);11574		}1157511576		auto_ptr<ICvCity1> pCity = GC.WrapCityPointer(this);11577		DLLUI->SetSpecificCityInfoDirty(pCity.get(), CITY_UPDATE_TYPE_BANNER);11578	}11579}

Calls

Called by