carnal_court_evaluate_sex_location_culture_effect = {
    if = {
        limit = {
            scope:carn_sex_partner.location.culture = {
                OR = {
                    has_graphical_western_culture_group_trigger = yes
                    has_graphical_norse_culture_group_trigger = yes
                }
            }
        }
        add_character_flag = {
            flag = carnal_court_sex_western
            days = 30 # So court won't break when something goes wrong
        }
    }
    else_if = {
        limit = {
            scope:carn_sex_partner.location.culture = {
                OR = {
                    has_graphical_mediterranean_culture_group_trigger = yes
                    AND = {
                        has_graphical_iberian_culture_group_trigger  = yes
                        NOT = { prev.religion = religion:islam_religion }
                    }
                }
            }
        }
        add_character_flag = {
            flag = carnal_court_sex_mediterranean
            days = 30 # So court won't break when something goes wrong
        }
    }
    else_if = {
        limit = {
            scope:carn_sex_partner.location.culture = {
                OR = {
                    has_graphical_mena_culture_group_trigger = yes
                    has_graphical_iranian_culture_group_trigger = yes
                    has_graphical_african_culture_group_trigger = yes
                    has_graphical_steppe_culture_group_trigger = yes
                    AND = {
                        has_graphical_iberian_culture_group_trigger  = yes
                        prev.religion = religion:islam_religion
                    }
                }
            }
        }
        add_character_flag = {
            flag = carnal_court_sex_mena
            days = 30 # So court won't break when something goes wrong
        }
    }
    else_if = {
        limit = {
            scope:carn_sex_partner.location.culture = {
                has_graphical_india_culture_group_trigger = yes
            }
        }
        add_character_flag = {
            flag = carnal_court_sex_indian
            days = 30 # So court won't break when something goes wrong
        }
    }
    else = {
        add_character_flag = {
            flag = carnal_court_sex_western # Fallback
            days = 30 # So court won't break when something goes wrong
        }
    }
}
