Bazaar developer reference

CvMilitaryAI::LogCivilizationDestroyed()

Defined in
CvMilitaryAI.cpp, line 1877
Class
CvMilitaryAI
Hook name
CivHooks::CvMilitaryAI_LogCivilizationDestroyed

Hooks

static bool BeforeCvMilitaryAI_LogCivilizationDestroyed(CvMilitaryAI* self);static void AfterCvMilitaryAI_LogCivilizationDestroyed(CvMilitaryAI* self);static void ReplaceCvMilitaryAI_LogCivilizationDestroyed(void (*original)(CvMilitaryAI*), CvMilitaryAI* self);CivRegisterBefore<CivHooks::CvMilitaryAI_LogCivilizationDestroyed>(host, &BeforeCvMilitaryAI_LogCivilizationDestroyed);CivRegisterAfter<CivHooks::CvMilitaryAI_LogCivilizationDestroyed>(host, &AfterCvMilitaryAI_LogCivilizationDestroyed);CivRegisterReplace<CivHooks::CvMilitaryAI_LogCivilizationDestroyed>(host, &ReplaceCvMilitaryAI_LogCivilizationDestroyed);

Code

1876/// Log it if we die1877void CvMilitaryAI::LogCivilizationDestroyed()1878{1879	if(GC.getLogging() && GC.getAILogging())1880	{1881		CvString strOutBuf;1882		CvString strBaseString;1883		CvString playerName;1884		CvString strTemp;1885		FILogFile* pLog;18861887		// Open the right file1888		playerName = GetPlayer()->getCivilizationShortDescription();1889		pLog = LOGFILEMGR.GetLog(GetLogFileName(playerName), FILogFile::kDontTimeStamp);18901891		// Get the leading info for this line1892		strBaseString.Format("%03d, ", GC.getGame().getElapsedGameTurns());1893		strBaseString += playerName + ", ";18941895		// Strategy Info1896		strTemp.Format("DESTROYED!");1897		strOutBuf = strBaseString + strTemp;1898		pLog->Msg(strOutBuf);18991900		LogMilitarySummaryMessage(strTemp);1901	}1902}

Calls