ai_stop_building_units = {
	if = {
		limit = { not = { has_country_flag = ai_no_unit_build } }
		set_country_flag = ai_no_unit_build
		add_ai_strategy = { type = role_ratio id = L_Inf value = -500 }
		add_ai_strategy = { type = role_ratio id = infantry value = -500 }
		add_ai_strategy = { type = role_ratio id = garrison value = -500 }
		add_ai_strategy = { type = role_ratio id = mechanized value = -500 }
		add_ai_strategy = { type = role_ratio id = armor value = -500 }
		add_ai_strategy = { type = role_ratio id = marines value = -500 }
		add_ai_strategy = { type = role_ratio id = Air_assault value = -500 }
		add_ai_strategy = { type = role_ratio id = Air_Inf value = -500 }
		add_ai_strategy = { type = role_ratio id = Special_Forces value = -500 }
		add_to_variable = { var = ai_wants_divisions value = 500 }
	}
		
}

ai_build_units = {
	if = {
		limit = { has_country_flag = ai_no_unit_build }
		clr_country_flag = ai_no_unit_build
		add_ai_strategy = { type = role_ratio id = L_Inf value = 600 }
		add_ai_strategy = { type = role_ratio id = infantry value = 600 }
		add_ai_strategy = { type = role_ratio id = garrison value = 600 }
		add_ai_strategy = { type = role_ratio id = mechanized value = 600 }
		add_ai_strategy = { type = role_ratio id = armor value = 600 }
		add_ai_strategy = { type = role_ratio id = marines value = 600 }
		add_ai_strategy = { type = role_ratio id = Air_assault value = 600 }
		add_ai_strategy = { type = role_ratio id = Air_Inf value = 600 }
		add_ai_strategy = { type = role_ratio id = Special_Forces value = 600 }
		add_to_variable = { var = ai_wants_divisions value = 500 }
	}
		
}
ai_update_build_units = {
	if = {
		limit = {
			has_country_flag = ai_no_unit_build
			or = {
				has_war = yes
				threat > 0.30
				is_bad_salafist = yes
				any_other_country = {
					OR = {
						is_justifying_wargoal_against = this
						has_wargoal_against = this
					}
				}
			}
		}
		clr_country_flag = ai_no_unit_build
		add_ai_strategy = { type = role_ratio id = L_Inf value = 500 }
		add_ai_strategy = { type = role_ratio id = infantry value = 500 }
		add_ai_strategy = { type = role_ratio id = garrison value = 500 }
		add_ai_strategy = { type = role_ratio id = mechanized value = 500 }
		add_ai_strategy = { type = role_ratio id = armor value = 500 }
		add_ai_strategy = { type = role_ratio id = marines value = 500 }
		add_ai_strategy = { type = role_ratio id = Air_assault value = 500 }
		add_ai_strategy = { type = role_ratio id = Air_Inf value = 500 }
		add_ai_strategy = { type = role_ratio id = Special_Forces value = 500 }
	}
	else = {
		set_country_flag = ai_no_unit_build
		add_ai_strategy = { type = role_ratio id = L_Inf value = -500 }
		add_ai_strategy = { type = role_ratio id = infantry value = -500 }
		add_ai_strategy = { type = role_ratio id = garrison value = -500 }
		add_ai_strategy = { type = role_ratio id = mechanized value = -500 }
		add_ai_strategy = { type = role_ratio id = armor value = -500 }
		add_ai_strategy = { type = role_ratio id = marines value = -500 }
		add_ai_strategy = { type = role_ratio id = Air_assault value = -500 }
		add_ai_strategy = { type = role_ratio id = Air_Inf value = -500 }
		add_ai_strategy = { type = role_ratio id = Special_Forces value = -500 }
	}
}

