Bazaar developer reference

CvPlayer::getMaxStockpile() const

Defined in
CvPlayer.cpp, line 8811
Class
CvPlayer
Hook name
CivHooks::CvPlayer_getMaxStockpile

Hooks

static bool BeforeCvPlayer_getMaxStockpile(const CvPlayer* self, int& result);static void AfterCvPlayer_getMaxStockpile(const CvPlayer* self, int& result);static int ReplaceCvPlayer_getMaxStockpile(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_getMaxStockpile>(host, &BeforeCvPlayer_getMaxStockpile);CivRegisterAfter<CivHooks::CvPlayer_getMaxStockpile>(host, &AfterCvPlayer_getMaxStockpile);CivRegisterReplace<CivHooks::CvPlayer_getMaxStockpile>(host, &ReplaceCvPlayer_getMaxStockpile);

Code

8811int CvPlayer::getMaxStockpile() const8812{8813	// The default of 30 hammers means a city can stockpile between 15% and 30% of the production of a World Wonder8814	int iProdPerEra = gCustomMods.getOption("PROCESS_STOCKPILE_PER_ERA", 30);8815	// Adjust for game speed8816	iProdPerEra *= GC.getGame().getGameSpeedInfo().getConstructPercent();88178818	return ((GetCurrentEra() + 1) * iProdPerEra) / 100;8819}

Calls

Called by