﻿setup_tributaries_effect = {
	#MGR: Fix for duchy creation and vassalization crash
	if = {
		limit = { 
			has_game_rule = mgr_aw_no_shattered_realms
		}
		if = {
			limit = { has_mpo_dlc_trigger = yes	}
			if = {
				limit = { current_date < 1066.9.15 } # so, 867
				mpo_867_tributary_setup_effect = yes
			}
			else_if = {
				limit = { current_date = 1066.9.15 }
				mpo_1066_tributary_setup_effect = yes
			}
			else_if = {
				limit = { current_date > 1066.9.15 } # so, 1178
				mpo_1178_tributary_setup_effect = yes
			}
		}
		if = {
			limit = { has_tgp_dlc_trigger = yes	}
			if = {
	    		limit = { current_date < 1066.9.15 } # so, 867
	        	tgp_867_tributary_setup_effect = yes
	    	}
	    	else_if = {
	    		limit = { current_date = 1066.9.15 }
	        	tgp_1066_tributary_setup_effect = yes
	    	}
	    	else_if = {
	    		limit = { current_date > 1066.9.15 } # so, 1178
	        	tgp_1178_tributary_setup_effect = yes
	    	}
		}
		if = {
			limit = {
				current_date < 1066.9.15
			}
			base_867_tributary_setup_effect = yes
		}
		else_if = {
			limit = { 
				current_date = 1066.9.15 
			}
			base_1066_tributary_setup_effect = yes
		}
		else_if = {
			limit = { 
				current_date > 1066.9.15
			}
			base_1178_tributary_setup_effect = yes
		}
	}
}
