Bazaar developer reference

CvLuaPlayer::lGetFreePromotionCount(lua_State *)

Defined in
Lua/CvLuaPlayer.cpp, line 10115
Class
CvLuaPlayer
Hook name
CivHooks::CvLuaPlayer_lGetFreePromotionCount

Hooks

static bool BeforeCvLuaPlayer_lGetFreePromotionCount(lua_State* L, int& result);static void AfterCvLuaPlayer_lGetFreePromotionCount(lua_State* L, int& result);static int ReplaceCvLuaPlayer_lGetFreePromotionCount(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaPlayer_lGetFreePromotionCount>(host, &BeforeCvLuaPlayer_lGetFreePromotionCount);CivRegisterAfter<CivHooks::CvLuaPlayer_lGetFreePromotionCount>(host, &AfterCvLuaPlayer_lGetFreePromotionCount);CivRegisterReplace<CivHooks::CvLuaPlayer_lGetFreePromotionCount>(host, &ReplaceCvLuaPlayer_lGetFreePromotionCount);

Code

10114//int GetFreePromotionCount() const;10115int CvLuaPlayer::lGetFreePromotionCount(lua_State* L)10116{10117	CvPlayerAI* pkPlayer = GetInstance(L);10118	int iPromotionIndex = lua_tointeger(L, 2);10119	int iResult = pkPlayer->GetFreePromotionCount((PromotionTypes)iPromotionIndex);10120	lua_pushinteger(L, iResult);10121	return 1;10122}

Calls

Called by