Bazaar developer reference

OperationalAIHelpers::GetGatherRangeForXUnits(int)

Defined in
CvAIOperation.cpp, line 5829
Hook name
CivHooks::OperationalAIHelpers_GetGatherRangeForXUnits

Hooks

static bool BeforeOperationalAIHelpers_GetGatherRangeForXUnits(int iTotalUnits, int& result);static void AfterOperationalAIHelpers_GetGatherRangeForXUnits(int iTotalUnits, int& result);static int ReplaceOperationalAIHelpers_GetGatherRangeForXUnits(int (*original)(int), int iTotalUnits);CivRegisterBefore<CivHooks::OperationalAIHelpers_GetGatherRangeForXUnits>(host, &BeforeOperationalAIHelpers_GetGatherRangeForXUnits);CivRegisterAfter<CivHooks::OperationalAIHelpers_GetGatherRangeForXUnits>(host, &AfterOperationalAIHelpers_GetGatherRangeForXUnits);CivRegisterReplace<CivHooks::OperationalAIHelpers_GetGatherRangeForXUnits>(host, &ReplaceOperationalAIHelpers_GetGatherRangeForXUnits);

Code

5829int OperationalAIHelpers::GetGatherRangeForXUnits(int iTotalUnits)5830{5831	int iRange = 0;58325833	if(iTotalUnits <= 2)5834	{5835		iRange = 1;5836	}5837	else if(iTotalUnits <= 6)5838	{5839		iRange = 2;5840	}5841	else if(iTotalUnits <= 10)5842	{5843		iRange = 3;5844	}5845	else5846	{5847		iRange = 4;5848	}58495850	return iRange;5851}

Called by