Bazaar developer reference

CvLuaPlayer::lGetNumPoliciesInBranch(lua_State *)

Defined in
Lua/CvLuaPlayer.cpp, line 5188
Class
CvLuaPlayer
Hook name
CivHooks::CvLuaPlayer_lGetNumPoliciesInBranch

Hooks

static bool BeforeCvLuaPlayer_lGetNumPoliciesInBranch(lua_State* L, int& result);static void AfterCvLuaPlayer_lGetNumPoliciesInBranch(lua_State* L, int& result);static int ReplaceCvLuaPlayer_lGetNumPoliciesInBranch(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaPlayer_lGetNumPoliciesInBranch>(host, &BeforeCvLuaPlayer_lGetNumPoliciesInBranch);CivRegisterAfter<CivHooks::CvLuaPlayer_lGetNumPoliciesInBranch>(host, &AfterCvLuaPlayer_lGetNumPoliciesInBranch);CivRegisterReplace<CivHooks::CvLuaPlayer_lGetNumPoliciesInBranch>(host, &ReplaceCvLuaPlayer_lGetNumPoliciesInBranch);

Code

5187//int GetNumPolicies();5188int CvLuaPlayer::lGetNumPoliciesInBranch(lua_State* L)5189{5190	CvPlayerAI* pkPlayer = GetInstance(L);5191	const PolicyBranchTypes eIndex = (PolicyBranchTypes)lua_tointeger(L, 2);51925193	const int iResult = pkPlayer->GetPlayerPolicies()->GetNumPoliciesOwnedInBranch(eIndex);5194	lua_pushinteger(L, iResult);5195	return 1;5196}

Calls

Called by