Bazaar developer reference

CvMinorCivAI::IsThreateningBarbariansEventActiveForPlayer(PlayerTypes)

Defined in
CvMinorCivAI.cpp, line 3223
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer

Hooks

static bool BeforeCvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer(CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer(CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer(bool (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer>(host, &BeforeCvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer);CivRegisterAfter<CivHooks::CvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer>(host, &AfterCvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer);CivRegisterReplace<CivHooks::CvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer>(host, &ReplaceCvMinorCivAI_IsThreateningBarbariansEventActiveForPlayer);

Code

3221/// Are there threatening barbarians that ePlayer can get credit for clearing out?3222/// NOTE: This event can be active even if we haven't sent ePlayer a notification (ex. is only one barb, ePlayer is far away)3223bool CvMinorCivAI::IsThreateningBarbariansEventActiveForPlayer(PlayerTypes ePlayer)3224{3225	if (GetPlayer()->isAlive())3226	{3227		if (IsHasMetPlayer(ePlayer) && !IsAtWarWithPlayersTeam(ePlayer))3228		{3229			if (GetNumThreateningBarbarians() > 0)3230			{3231				return true;3232			}3233		}3234	}3235	3236	return false;3237}

Calls

Called by