Bazaar developer reference

CvCity::getHurryCost(bool, int, int, int) const

Defined in
CvCity.cpp, line 7514
Class
CvCity
Hook name
CivHooks::CvCity_getHurryCost_with_bool_int_int_int_const

Hooks

static bool BeforeCvCity_getHurryCost_with_bool_int_int_int_const(const CvCity* self, bool bExtra, int iProductionLeft, int iHurryModifier, int iModifier, int& result);static void AfterCvCity_getHurryCost_with_bool_int_int_int_const(const CvCity* self, bool bExtra, int iProductionLeft, int iHurryModifier, int iModifier, int& result);static int ReplaceCvCity_getHurryCost_with_bool_int_int_int_const(int (*original)(const CvCity*, bool, int, int, int), const CvCity* self, bool bExtra, int iProductionLeft, int iHurryModifier, int iModifier);CivRegisterBefore<CivHooks::CvCity_getHurryCost_with_bool_int_int_int_const>(host, &BeforeCvCity_getHurryCost_with_bool_int_int_int_const);CivRegisterAfter<CivHooks::CvCity_getHurryCost_with_bool_int_int_int_const>(host, &AfterCvCity_getHurryCost_with_bool_int_int_int_const);CivRegisterReplace<CivHooks::CvCity_getHurryCost_with_bool_int_int_int_const>(host, &ReplaceCvCity_getHurryCost_with_bool_int_int_int_const);

Code

7514int CvCity::getHurryCost(bool bExtra, int iProductionLeft, int iHurryModifier, int iModifier) const7515{7516	VALIDATE_OBJECT7517	int iProduction = (iProductionLeft * iHurryModifier + 99) / 100; // round up75187519	if(bExtra)7520	{7521		int iExtraProduction = getExtraProductionDifference(iProduction, iModifier);7522		if(iExtraProduction > 0)7523		{7524			int iAdjustedProd = iProduction * iProduction;75257526			// round up7527			iProduction = (iAdjustedProd + (iExtraProduction - 1)) / iExtraProduction;7528		}7529	}75307531	return std::max(0, iProduction);7532}

Calls

Called by