Bazaar developer reference

CvPlayer::IsEmpireUnhappy() const

Defined in
CvPlayer.cpp, line 11525
Class
CvPlayer
Hook name
CivHooks::CvPlayer_IsEmpireUnhappy

Hooks

static bool BeforeCvPlayer_IsEmpireUnhappy(const CvPlayer* self, bool& result);static void AfterCvPlayer_IsEmpireUnhappy(const CvPlayer* self, bool& result);static bool ReplaceCvPlayer_IsEmpireUnhappy(bool (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_IsEmpireUnhappy>(host, &BeforeCvPlayer_IsEmpireUnhappy);CivRegisterAfter<CivHooks::CvPlayer_IsEmpireUnhappy>(host, &AfterCvPlayer_IsEmpireUnhappy);CivRegisterReplace<CivHooks::CvPlayer_IsEmpireUnhappy>(host, &ReplaceCvPlayer_IsEmpireUnhappy);

Code

11524/// Has the player passed the Happiness limit?11525bool CvPlayer::IsEmpireUnhappy() const11526{11527	if(GC.getGame().isOption(GAMEOPTION_NO_HAPPINESS))11528	{11529		return false;11530	}1153111532	if(GetExcessHappiness() < 0)11533	{11534		return true;11535	}1153611537	return false;11538}

Calls

Called by