Bazaar developer reference

CvGame::IsUnitedNationsActive()

Defined in
CvGame.cpp, line 5253
Class
CvGame
Hook name
CivHooks::CvGame_IsUnitedNationsActive

Hooks

static bool BeforeCvGame_IsUnitedNationsActive(CvGame* self, bool& result);static void AfterCvGame_IsUnitedNationsActive(CvGame* self, bool& result);static bool ReplaceCvGame_IsUnitedNationsActive(bool (*original)(CvGame*), CvGame* self);CivRegisterBefore<CivHooks::CvGame_IsUnitedNationsActive>(host, &BeforeCvGame_IsUnitedNationsActive);CivRegisterAfter<CivHooks::CvGame_IsUnitedNationsActive>(host, &AfterCvGame_IsUnitedNationsActive);CivRegisterReplace<CivHooks::CvGame_IsUnitedNationsActive>(host, &ReplaceCvGame_IsUnitedNationsActive);

Code

5252/// Is the UN active? (Diplo Victory)5253bool CvGame::IsUnitedNationsActive()5254{5255	if (!GC.getGame().isOption(GAMEOPTION_NO_LEAGUES))5256	{5257		if (GetGameLeagues()->GetNumActiveLeagues() > 0)5258		{5259			CvLeague* pLeague = GetGameLeagues()->GetActiveLeague();5260			if (pLeague != NULL)5261			{5262				if (pLeague->IsUnitedNations())5263				{5264					return true;5265				}5266			}5267		}5268	}52695270	return false;5271}

Calls

Called by