Bazaar developer reference

CvLuaPlayer::lGetUnhappinessFromCityCount(lua_State *)

Defined in
Lua/CvLuaPlayer.cpp, line 3250
Class
CvLuaPlayer
Hook name
CivHooks::CvLuaPlayer_lGetUnhappinessFromCityCount

Hooks

static bool BeforeCvLuaPlayer_lGetUnhappinessFromCityCount(lua_State* L, int& result);static void AfterCvLuaPlayer_lGetUnhappinessFromCityCount(lua_State* L, int& result);static int ReplaceCvLuaPlayer_lGetUnhappinessFromCityCount(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaPlayer_lGetUnhappinessFromCityCount>(host, &BeforeCvLuaPlayer_lGetUnhappinessFromCityCount);CivRegisterAfter<CivHooks::CvLuaPlayer_lGetUnhappinessFromCityCount>(host, &AfterCvLuaPlayer_lGetUnhappinessFromCityCount);CivRegisterReplace<CivHooks::CvLuaPlayer_lGetUnhappinessFromCityCount>(host, &ReplaceCvLuaPlayer_lGetUnhappinessFromCityCount);

Code

3249//int GetUnhappinessFromCityCount() const;3250int CvLuaPlayer::lGetUnhappinessFromCityCount(lua_State* L)3251{3252	CvPlayerAI* pkPlayer = GetInstance(L);3253	CvCity* pAnnexedCity = CvLuaCity::GetInstance(L, 2, false);3254	CvCity* pPuppetedCity = CvLuaCity::GetInstance(L, 3, false);3255	const int iResult = pkPlayer->GetUnhappinessFromCityCount(pAnnexedCity, pPuppetedCity);3256	lua_pushinteger(L, iResult);3257	return 1;3258}

Calls

Called by