Bazaar developer reference

GetRandomMajorPlayer()

Defined in
CvGame.cpp, line 11535
Hook name
CivHooks::GetRandomMajorPlayer

Hooks

static bool BeforeGetRandomMajorPlayer(PlayerTypes& result);static void AfterGetRandomMajorPlayer(PlayerTypes& result);static PlayerTypes ReplaceGetRandomMajorPlayer(PlayerTypes (*original)());CivRegisterBefore<CivHooks::GetRandomMajorPlayer>(host, &BeforeGetRandomMajorPlayer);CivRegisterAfter<CivHooks::GetRandomMajorPlayer>(host, &AfterGetRandomMajorPlayer);CivRegisterReplace<CivHooks::GetRandomMajorPlayer>(host, &ReplaceGetRandomMajorPlayer);

Code

11535PlayerTypes GetRandomMajorPlayer()11536{11537	PlayerTypes ePlayer = NO_PLAYER;11538	do 11539	{11540		ePlayer = static_cast<PlayerTypes>(GC.getGame().getJonRandNum(MAX_MAJOR_CIVS, "Random Major Civ"));11541	} while (!GET_PLAYER(ePlayer).isEverAlive());11542	return ePlayer;11543}

Calls

Called by