Bazaar developer reference

CvPlayerPolicies::SetOneShotPolicyFired(PolicyTypes, bool)

Defined in
CvPolicyClasses.cpp, line 2923
Class
CvPlayerPolicies
Hook name
CivHooks::CvPlayerPolicies_SetOneShotPolicyFired

Hooks

static bool BeforeCvPlayerPolicies_SetOneShotPolicyFired(CvPlayerPolicies* self, PolicyTypes eIndex, bool bFired);static void AfterCvPlayerPolicies_SetOneShotPolicyFired(CvPlayerPolicies* self, PolicyTypes eIndex, bool bFired);static void ReplaceCvPlayerPolicies_SetOneShotPolicyFired(void (*original)(CvPlayerPolicies*, PolicyTypes, bool), CvPlayerPolicies* self, PolicyTypes eIndex, bool bFired);CivRegisterBefore<CivHooks::CvPlayerPolicies_SetOneShotPolicyFired>(host, &BeforeCvPlayerPolicies_SetOneShotPolicyFired);CivRegisterAfter<CivHooks::CvPlayerPolicies_SetOneShotPolicyFired>(host, &AfterCvPlayerPolicies_SetOneShotPolicyFired);CivRegisterReplace<CivHooks::CvPlayerPolicies_SetOneShotPolicyFired>(host, &ReplaceCvPlayerPolicies_SetOneShotPolicyFired);

Code

2922/// mark a one shot policy as spent2923void CvPlayerPolicies::SetOneShotPolicyFired(PolicyTypes eIndex, bool bFired)2924{2925	CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");2926	CvAssertMsg(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");2927	m_pabHasOneShotPolicyFired[eIndex] = bFired;2928}

Called by