############################################################################################################
#	Expert AI mod - scripted AI effects
############################################################################################################

EAI_PATHFIND_strategies = {

	if = { limit = { tag = ITA } EAI_path_exists_from_east_africa_to_north_africa = yes }
	if = { limit = { tag = GER } EAI_path_exists_from_berlin_to_tehran = yes }
}

EAI_path_exists_from_east_africa_to_north_africa = {
	
	set_temp_variable = { _pathfind_start = 271.id }
	set_temp_variable = { _pathfind_target = 450.id }
	set_temp_variable = { _pathfind_type = 2 }
	EAI_PATHFIND_get_path = yes

	if = { limit = { check_variable = { pathfind_success = 1 } }

		set_country_flag = EAI_path_exists_from_east_africa_to_north_africa
	}
	else = {

		clr_country_flag = EAI_path_exists_from_east_africa_to_north_africa
	}
}

EAI_path_exists_from_berlin_to_tehran = {
	
	set_temp_variable = { _pathfind_start = 64.id }
	set_temp_variable = { _pathfind_target = 266.id }
	set_temp_variable = { _pathfind_type = 2 }
	EAI_PATHFIND_get_path = yes

	if = { limit = { check_variable = { pathfind_success = 1 } }

		set_country_flag = EAI_path_exists_from_berlin_to_tehran
	}
	else = {

		clr_country_flag = EAI_path_exists_from_berlin_to_tehran
	}
}