Bazaar developer reference

CvGame::calculateOptionsChecksum()

Defined in
CvGame.cpp, line 9418
Class
CvGame
Hook name
CivHooks::CvGame_calculateOptionsChecksum

Hooks

static bool BeforeCvGame_calculateOptionsChecksum(CvGame* self, int& result);static void AfterCvGame_calculateOptionsChecksum(CvGame* self, int& result);static int ReplaceCvGame_calculateOptionsChecksum(int (*original)(CvGame*), CvGame* self);CivRegisterBefore<CivHooks::CvGame_calculateOptionsChecksum>(host, &BeforeCvGame_calculateOptionsChecksum);CivRegisterAfter<CivHooks::CvGame_calculateOptionsChecksum>(host, &AfterCvGame_calculateOptionsChecksum);CivRegisterReplace<CivHooks::CvGame_calculateOptionsChecksum>(host, &ReplaceCvGame_calculateOptionsChecksum);

Code

9418int CvGame::calculateOptionsChecksum()9419{9420	int iValue;9421	int iI, iJ;94229423	iValue = 0;94249425	for(iI = 0; iI < MAX_PLAYERS; iI++)9426	{9427		CvPlayer& kPlayer = GET_PLAYER((PlayerTypes)iI);94289429		for(iJ = 0; iJ < GC.getNumPlayerOptionInfos(); iJ++)9430		{9431			CvPlayerOptionInfo* pkInfo = GC.getPlayerOptionInfo((PlayerOptionTypes)iJ);9432			if (pkInfo)9433			{9434				uint uiID = FString::Hash( pkInfo->GetType() );9435				if(kPlayer.isOption((PlayerOptionTypes)uiID))9436				{9437					iValue += (iI * 943097);9438					iValue += (iJ * 281541);9439				}9440			}9441		}9442	}94439444	return iValue;9445}

Calls

Called by