Bazaar developer reference

CvLuaPlayer::lSetPolicyBranchUnlocked(lua_State *)

Defined in
Lua/CvLuaPlayer.cpp, line 5123
Class
CvLuaPlayer
Hook name
CivHooks::CvLuaPlayer_lSetPolicyBranchUnlocked

Hooks

static bool BeforeCvLuaPlayer_lSetPolicyBranchUnlocked(lua_State* L, int& result);static void AfterCvLuaPlayer_lSetPolicyBranchUnlocked(lua_State* L, int& result);static int ReplaceCvLuaPlayer_lSetPolicyBranchUnlocked(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaPlayer_lSetPolicyBranchUnlocked>(host, &BeforeCvLuaPlayer_lSetPolicyBranchUnlocked);CivRegisterAfter<CivHooks::CvLuaPlayer_lSetPolicyBranchUnlocked>(host, &AfterCvLuaPlayer_lSetPolicyBranchUnlocked);CivRegisterReplace<CivHooks::CvLuaPlayer_lSetPolicyBranchUnlocked>(host, &ReplaceCvLuaPlayer_lSetPolicyBranchUnlocked);

Code

5122//void SetPolicyBranchUnlocked();5123int CvLuaPlayer::lSetPolicyBranchUnlocked(lua_State* L)5124{5125	CvPlayerAI* pkPlayer = GetInstance(L);5126	const PolicyBranchTypes eBranchType = (PolicyBranchTypes)lua_tointeger(L, 2);5127	const bool bNewValue = lua_toboolean(L, 3);5128	const bool bRevolution = lua_toboolean(L, 4);51295130	pkPlayer->GetPlayerPolicies()->SetPolicyBranchUnlocked(eBranchType, bNewValue, bRevolution);5131	return 1;5132}

Calls

Called by