Bazaar developer reference

CvPlayerTechs::SetLocaleTechPriority(TechTypes, int)

Defined in
CvTechClasses.cpp, line 939
Class
CvPlayerTechs
Hook name
CivHooks::CvPlayerTechs_SetLocaleTechPriority

Hooks

static bool BeforeCvPlayerTechs_SetLocaleTechPriority(CvPlayerTechs* self, TechTypes eIndex, int iNewValue);static void AfterCvPlayerTechs_SetLocaleTechPriority(CvPlayerTechs* self, TechTypes eIndex, int iNewValue);static void ReplaceCvPlayerTechs_SetLocaleTechPriority(void (*original)(CvPlayerTechs*, TechTypes, int), CvPlayerTechs* self, TechTypes eIndex, int iNewValue);CivRegisterBefore<CivHooks::CvPlayerTechs_SetLocaleTechPriority>(host, &BeforeCvPlayerTechs_SetLocaleTechPriority);CivRegisterAfter<CivHooks::CvPlayerTechs_SetLocaleTechPriority>(host, &AfterCvPlayerTechs_SetLocaleTechPriority);CivRegisterReplace<CivHooks::CvPlayerTechs_SetLocaleTechPriority>(host, &ReplaceCvPlayerTechs_SetLocaleTechPriority);

Code

938/// Accessor: set locale priority multiplier for researching techs (for instance techs that unlock nearby resources)939void CvPlayerTechs::SetLocaleTechPriority(TechTypes eIndex, int iNewValue)940{941	CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");942	CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");943944	m_piLocaleTechPriority[eIndex] = iNewValue;945}