CvLuaPlayer::lIsProtectedByMajor(lua_State *)
- Defined in
- Lua/CvLuaPlayer.cpp, line 6968
- Class
- CvLuaPlayer
- Hook name
CivHooks::CvLuaPlayer_lIsProtectedByMajor
Hooks
static bool BeforeCvLuaPlayer_lIsProtectedByMajor(lua_State* L, int& result);static void AfterCvLuaPlayer_lIsProtectedByMajor(lua_State* L, int& result);static int ReplaceCvLuaPlayer_lIsProtectedByMajor(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaPlayer_lIsProtectedByMajor>(host, &BeforeCvLuaPlayer_lIsProtectedByMajor);CivRegisterAfter<CivHooks::CvLuaPlayer_lIsProtectedByMajor>(host, &AfterCvLuaPlayer_lIsProtectedByMajor);CivRegisterReplace<CivHooks::CvLuaPlayer_lIsProtectedByMajor>(host, &ReplaceCvLuaPlayer_lIsProtectedByMajor);
Code
6967//bool IsProtectedByMajor(PlayerTypes eMajor);6968int CvLuaPlayer::lIsProtectedByMajor(lua_State* L)6969{6970 CvPlayerAI* pkPlayer = GetInstance(L);6971 PlayerTypes eMajor = (PlayerTypes) lua_tointeger(L, 2);69726973 const bool bResult = pkPlayer->GetMinorCivAI()->IsProtectedByMajor(eMajor);6974 lua_pushboolean(L, bResult);6975 return 1;6976}
Calls
CvLuaScopedInstance::GetInstance- CvMinorCivAI::IsProtectedByMajor(PlayerTypes) const
- CvPlayer::GetMinorCivAI() const
lua_pushbooleanlua_tointeger