Bazaar developer reference

CvEspionageAI::UpdateCivOutOfTechTurn()

Defined in
CvEspionageClasses.cpp, line 5077
Class
CvEspionageAI
Hook name
CivHooks::CvEspionageAI_UpdateCivOutOfTechTurn

Hooks

static bool BeforeCvEspionageAI_UpdateCivOutOfTechTurn(CvEspionageAI* self);static void AfterCvEspionageAI_UpdateCivOutOfTechTurn(CvEspionageAI* self);static void ReplaceCvEspionageAI_UpdateCivOutOfTechTurn(void (*original)(CvEspionageAI*), CvEspionageAI* self);CivRegisterBefore<CivHooks::CvEspionageAI_UpdateCivOutOfTechTurn>(host, &BeforeCvEspionageAI_UpdateCivOutOfTechTurn);CivRegisterAfter<CivHooks::CvEspionageAI_UpdateCivOutOfTechTurn>(host, &AfterCvEspionageAI_UpdateCivOutOfTechTurn);CivRegisterReplace<CivHooks::CvEspionageAI_UpdateCivOutOfTechTurn>(host, &ReplaceCvEspionageAI_UpdateCivOutOfTechTurn);

Code

5077void CvEspionageAI::UpdateCivOutOfTechTurn()5078{5079	CvPlayerEspionage* pEspionage = m_pPlayer->GetEspionage();50805081	// determine which civs have run out of techs to steal5082	for(uint ui = 0; ui < MAX_MAJOR_CIVS; ui++)5083	{5084		PlayerTypes eOtherPlayer = (PlayerTypes)ui;50855086		if(m_pPlayer->GetID() == eOtherPlayer)5087		{5088			continue;5089		}50905091		// if surveillance has not been established, continue5092		if(!pEspionage->IsAnySurveillanceEstablished(eOtherPlayer))5093		{5094			continue;5095		}50965097		pEspionage->BuildStealableTechList(eOtherPlayer);5098		if(pEspionage->m_aaPlayerStealableTechList[eOtherPlayer].size() > 0)5099		{5100			continue;5101		}5102		m_aiCivOutOfTechTurn[eOtherPlayer] = GC.getGame().getGameTurn();5103		if(GC.getLogging())5104		{5105			CvString strMsg;5106			strMsg.Format("AI no more tech to steal,");5107			strMsg += ",";5108			strMsg += ",";5109			strMsg += GET_PLAYER(eOtherPlayer).getCivilizationShortDescription();5110			strMsg += ",";5111			pEspionage->LogEspionageMsg(strMsg);5112		}5113	}5114}

Calls

Called by