Bazaar developer reference

CvCity::doProcess()

Defined in
CvCity.cpp, line 14953
Class
CvCity
Hook name
CivHooks::CvCity_doProcess

Hooks

static bool BeforeCvCity_doProcess(CvCity* self);static void AfterCvCity_doProcess(CvCity* self);static void ReplaceCvCity_doProcess(void (*original)(CvCity*), CvCity* self);CivRegisterBefore<CivHooks::CvCity_doProcess>(host, &BeforeCvCity_doProcess);CivRegisterAfter<CivHooks::CvCity_doProcess>(host, &AfterCvCity_doProcess);CivRegisterReplace<CivHooks::CvCity_doProcess>(host, &ReplaceCvCity_doProcess);

Code

14953void CvCity::doProcess()14954{14955	ProcessTypes eProcess = getProductionProcess();14956	CvAssertMsg(eProcess != NO_PROCESS, "Invalid Process for city production. Please send Anton your save file and version.");14957	if (eProcess == NO_PROCESS) return;1495814959	// Contribute production to a League project14960	for(int iI = 0; iI < GC.getNumLeagueProjectInfos(); iI++)14961	{14962		LeagueProjectTypes eLeagueProject = (LeagueProjectTypes) iI;14963		CvLeagueProjectEntry* pInfo = GC.getLeagueProjectInfo(eLeagueProject);14964		if (pInfo)14965		{14966			if (pInfo->GetProcess() == eProcess)14967			{14968				GC.getGame().GetGameLeagues()->DoLeagueProjectContribution(getOwner(), eLeagueProject, getCurrentProductionDifferenceTimes100(false, true));14969			}14970		}14971	}14972	14973#if defined(MOD_PROCESS_STOCKPILE)14974	if (MOD_PROCESS_STOCKPILE && eProcess == GC.getInfoTypeForString("PROCESS_STOCKPILE"))14975	{14976		int iPile = getCurrentProductionDifferenceTimes100(false, false);14977		// Can't use changeOverflowProductionTimes100() here as it asserts above 250 production14978		setOverflowProductionTimes100(getOverflowProductionTimes100() + iPile);14979		// CUSTOMLOG("Adding %i production to the stockpile of %s (for a total of %i)", iPile/100, getName().c_str(), getOverflowProduction());14980	}14981#endif14982}

Calls

Called by