Bazaar developer reference

CvDiplomacyAI::GetWarmongerThreatScore(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 23344
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetWarmongerThreatScore

Hooks

static bool BeforeCvDiplomacyAI_GetWarmongerThreatScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetWarmongerThreatScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetWarmongerThreatScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetWarmongerThreatScore>(host, &BeforeCvDiplomacyAI_GetWarmongerThreatScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetWarmongerThreatScore>(host, &AfterCvDiplomacyAI_GetWarmongerThreatScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetWarmongerThreatScore>(host, &ReplaceCvDiplomacyAI_GetWarmongerThreatScore);

Code

23344int CvDiplomacyAI::GetWarmongerThreatScore(PlayerTypes ePlayer)23345{23346	// EFB: Removed the divided by 2 in the next line (09/15/2013); all scaling now done and explained in GetOtherPlayerWarmongerScore()23347	int iOpinionWeight = GetOtherPlayerWarmongerScore(ePlayer);23348	if (iOpinionWeight < 5)23349	{23350		iOpinionWeight = 0;23351	}2335223353	return iOpinionWeight;23354}

Calls

Called by