CvLuaUnit::lCanPromote(lua_State *)
- Defined in
- Lua/CvLuaUnit.cpp, line 1730
- Class
- CvLuaUnit
- Hook name
CivHooks::CvLuaUnit_lCanPromote
Hooks
static bool BeforeCvLuaUnit_lCanPromote(lua_State* L, int& result);static void AfterCvLuaUnit_lCanPromote(lua_State* L, int& result);static int ReplaceCvLuaUnit_lCanPromote(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaUnit_lCanPromote>(host, &BeforeCvLuaUnit_lCanPromote);CivRegisterAfter<CivHooks::CvLuaUnit_lCanPromote>(host, &AfterCvLuaUnit_lCanPromote);CivRegisterReplace<CivHooks::CvLuaUnit_lCanPromote>(host, &ReplaceCvLuaUnit_lCanPromote);
Code
1729//bool canPromote(int /*PromotionTypes*/ ePromotion, int iLeaderUnitId);1730int CvLuaUnit::lCanPromote(lua_State* L)1731{1732 CvUnit* pkUnit = GetInstance(L);1733 const PromotionTypes ePromotion = (PromotionTypes)lua_tointeger(L, 2);1734 const int iLeaderUnitId = lua_tointeger(L, 3);1735 const bool bResult = pkUnit->canPromote(ePromotion, iLeaderUnitId);17361737 lua_pushboolean(L, bResult);1738 return 1;1739}
Calls
CvLuaScopedInstance::GetInstance- CvUnit::canPromote(PromotionTypes, int) const
lua_pushbooleanlua_tointeger