Bazaar developer reference

PreparingForWar(CvPlayerAI *)

Defined in
CvPlayerAI.cpp, line 1038
Hook name
CivHooks::PreparingForWar

Hooks

static bool BeforePreparingForWar(CvPlayerAI* pPlayer, bool& result);static void AfterPreparingForWar(CvPlayerAI* pPlayer, bool& result);static bool ReplacePreparingForWar(bool (*original)(CvPlayerAI*), CvPlayerAI* pPlayer);CivRegisterBefore<CivHooks::PreparingForWar>(host, &BeforePreparingForWar);CivRegisterAfter<CivHooks::PreparingForWar>(host, &AfterPreparingForWar);CivRegisterReplace<CivHooks::PreparingForWar>(host, &ReplacePreparingForWar);

Code

1038bool PreparingForWar(CvPlayerAI* pPlayer)1039{1040	CvAssertMsg(pPlayer, "Need a player");1041	if(!pPlayer)1042	{1043		return false;1044	}1045	CvMilitaryAI* pMilitaryAI = pPlayer->GetMilitaryAI();1046	CvAssertMsg(pMilitaryAI, "No military AI");1047	if(!pMilitaryAI)1048	{1049		return false;1050	}10511052	MilitaryAIStrategyTypes eWarMobilizationStrategy = (MilitaryAIStrategyTypes)GC.getInfoTypeForString("MILITARYAISTRATEGY_WAR_MOBILIZATION");1053	if(pMilitaryAI->IsUsingStrategy(eWarMobilizationStrategy))1054	{1055		return true;1056	}10571058	return false;1059}

Calls

Called by