CvPlayer::updateExtraYieldThreshold(YieldTypes)
- Defined in
- CvPlayer.cpp, line 18742
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_updateExtraYieldThreshold
Hooks
static bool BeforeCvPlayer_updateExtraYieldThreshold(CvPlayer* self, YieldTypes eIndex);static void AfterCvPlayer_updateExtraYieldThreshold(CvPlayer* self, YieldTypes eIndex);static void ReplaceCvPlayer_updateExtraYieldThreshold(void (*original)(CvPlayer*, YieldTypes), CvPlayer* self, YieldTypes eIndex);CivRegisterBefore<CivHooks::CvPlayer_updateExtraYieldThreshold>(host, &BeforeCvPlayer_updateExtraYieldThreshold);CivRegisterAfter<CivHooks::CvPlayer_updateExtraYieldThreshold>(host, &AfterCvPlayer_updateExtraYieldThreshold);CivRegisterReplace<CivHooks::CvPlayer_updateExtraYieldThreshold>(host, &ReplaceCvPlayer_updateExtraYieldThreshold);
Code
18742void CvPlayer::updateExtraYieldThreshold(YieldTypes eIndex)18743{18744 int iBestValue;1874518746 CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");18747 CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)");1874818749 iBestValue = GetPlayerTraits()->GetExtraYieldThreshold(eIndex);1875018751 if(getExtraYieldThreshold(eIndex) != iBestValue)18752 {18753 m_aiExtraYieldThreshold.setAt(eIndex, iBestValue);18754 CvAssert(getExtraYieldThreshold(eIndex) >= 0);1875518756 updateYield();18757 }18758}