Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/military/military.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2749,6 +2749,17 @@ void add_to_war(sys::state& state, dcon::war_id w, dcon::nation_id n, bool as_at
if(state.world.nation_get_owned_province_count(n) == 0)
return;

auto already_at_war = false;

state.world.nation_for_each_war_participant(n, [&](auto participant){
if (state.world.war_participant_get_war(participant) == w) {
already_at_war = true;
}
});

if (already_at_war)
return;

state.trade_route_cached_values_out_of_date = true;

auto participant = state.world.force_create_war_participant(w, n);
Expand Down Expand Up @@ -3435,6 +3446,10 @@ void implement_war_goal(sys::state& state, dcon::war_id war, dcon::cb_type_id wa
nations::make_vassal(state, target, from);
take_from_sphere(state, target, from);
}

for(auto war_participant : state.world.nation_get_war_participant(target)) {
military::add_to_war(state, war_participant.get_war(), from, war_participant.get_is_attacker());
}
}

// po_make_substate: the target nation releases all of its vassals and then becomes a vassal of the acting nation.
Expand Down
Loading