Bazaar developer reference

CvGame::getJonRandNumVA(int, const char *, ...)

Defined in
CvGame.cpp, line 9276
Class
CvGame
Not a hook point
variadic

Code

9272/// Get a synchronous random number in the range of 0...iNum-19273/// Allows for logging.9274// Unfortunately we need to name the method differently so that the non-va one can still exist without9275// causing ambiguous call errors.  The non VA one is needed for use as a delegate9276int CvGame::getJonRandNumVA(int iNum, const char* pszLog, ...)9277{9278	if (pszLog)9279	{9280		const size_t uiOutputSize = 512;9281		char szOutput[uiOutputSize];92829283		va_list vl;9284		va_start(vl, pszLog);9285		vsprintf_s(szOutput, uiOutputSize, pszLog, vl);9286		va_end(vl);92879288#if defined(MOD_BUGFIX_RANDOM)9289		return getJonRandNum(iNum, szOutput);9290#else9291		return m_jonRand.get(iNum, szOutput);9292#endif9293	}9294	else9295#if defined(MOD_BUGFIX_RANDOM)9296		return getJonRandNum(iNum, NULL);9297#else9298		return m_jonRand.get(iNum);9299#endif9300}

Calls

Called by