Bazaar developer reference

CvPlayer::GetNumUnitsSupplied() const

Defined in
CvPlayer.cpp, line 9700
Class
CvPlayer
Hook name
CivHooks::CvPlayer_GetNumUnitsSupplied

Hooks

static bool BeforeCvPlayer_GetNumUnitsSupplied(const CvPlayer* self, int& result);static void AfterCvPlayer_GetNumUnitsSupplied(const CvPlayer* self, int& result);static int ReplaceCvPlayer_GetNumUnitsSupplied(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_GetNumUnitsSupplied>(host, &BeforeCvPlayer_GetNumUnitsSupplied);CivRegisterAfter<CivHooks::CvPlayer_GetNumUnitsSupplied>(host, &AfterCvPlayer_GetNumUnitsSupplied);CivRegisterReplace<CivHooks::CvPlayer_GetNumUnitsSupplied>(host, &ReplaceCvPlayer_GetNumUnitsSupplied);

Code

9699/// How many Units can we support for free without paying Production?9700int CvPlayer::GetNumUnitsSupplied() const9701{9702	int iFreeUnits = GetNumUnitsSuppliedByHandicap();9703	iFreeUnits += GetNumUnitsSuppliedByCities();9704	iFreeUnits += GetNumUnitsSuppliedByPopulation();97059706	if(!isMinorCiv() && !isHuman() && !IsAITeammateOfHuman())9707	{9708		int iMod = (100 + GC.getGame().getHandicapInfo().getAIUnitSupplyPercent());9709		iFreeUnits *= iMod;9710		iFreeUnits /= 100;9711	}97129713	return iFreeUnits;9714}

Calls

Called by