Hooks
static bool BeforeCvCity_getProductionTurnsLeft_with_UnitTypes_int_const(const CvCity* self, UnitTypes eUnit, int iNum, int& result);static void AfterCvCity_getProductionTurnsLeft_with_UnitTypes_int_const(const CvCity* self, UnitTypes eUnit, int iNum, int& result);static int ReplaceCvCity_getProductionTurnsLeft_with_UnitTypes_int_const(int (*original)(const CvCity*, UnitTypes, int), const CvCity* self, UnitTypes eUnit, int iNum);CivRegisterBefore<CivHooks::CvCity_getProductionTurnsLeft_with_UnitTypes_int_const>(host, &BeforeCvCity_getProductionTurnsLeft_with_UnitTypes_int_const);CivRegisterAfter<CivHooks::CvCity_getProductionTurnsLeft_with_UnitTypes_int_const>(host, &AfterCvCity_getProductionTurnsLeft_with_UnitTypes_int_const);CivRegisterReplace<CivHooks::CvCity_getProductionTurnsLeft_with_UnitTypes_int_const>(host, &ReplaceCvCity_getProductionTurnsLeft_with_UnitTypes_int_const);
Code
4832int CvCity::getProductionTurnsLeft(UnitTypes eUnit, int iNum) const4833{4834 VALIDATE_OBJECT4835 int iProduction;4836 int iFirstUnitOrder;4837 int iProductionNeeded;4838 int iProductionModifier;48394840 iProduction = 0;48414842 iFirstUnitOrder = getFirstUnitOrder(eUnit);48434844 if((iFirstUnitOrder == -1) || (iFirstUnitOrder == iNum))4845 {4846 iProduction += getUnitProductionTimes100(eUnit);4847 }48484849 iProductionNeeded = getProductionNeeded(eUnit) * 100;4850 iProductionModifier = getProductionModifier(eUnit);48514852 return getProductionTurnsLeft(iProductionNeeded, iProduction, getProductionDifferenceTimes100(iProductionNeeded, iProduction, iProductionModifier, isFoodProduction(eUnit), (iNum == 0)), getProductionDifferenceTimes100(iProductionNeeded, iProduction, iProductionModifier, isFoodProduction(eUnit), false));4853}