﻿# Called only on the new human player after their previous character's death.
# Copy the effective policy, not the predecessor's pact/pending-choice history.
# Manual wins over stale auto flags; automatic precedence matches the dispatcher.
# No explicit source policy means the existing default, Manual Choice.
nmt_inherit_diplomacy_policy_effect = {
	nmt_clear_diplomacy_policy_effect = yes
	if = {
		limit = { scope:previous_player_character = { has_variable = nmt_policy_manual_choice } }
		set_variable = nmt_policy_manual_choice
	}
	else_if = {
		limit = { scope:previous_player_character = { has_variable = nmt_policy_auto_alliance } }
		set_variable = nmt_policy_auto_alliance
	}
	else_if = {
		limit = { scope:previous_player_character = { has_variable = nmt_policy_auto_truce } }
		set_variable = nmt_policy_auto_truce
	}
	else_if = {
		limit = { scope:previous_player_character = { has_variable = nmt_policy_auto_neither } }
		set_variable = nmt_policy_auto_neither
	}
	else = { set_variable = nmt_policy_manual_choice }
	# Also carry over the choice made for each in-law, and review the heir's ties.
	nmt_inherit_bonds_effect = yes
	send_interface_toast = {
		type = event_toast_effect_neutral
		title = nmt_policy_inherited_title
		custom_tooltip = nmt_policy_inherited_details
		left_icon = root
	}
}
