Skip to content

Commit

Permalink
fx
Browse files Browse the repository at this point in the history
  • Loading branch information
Lizzie841 committed Apr 7, 2024
1 parent bd37935 commit 025eb6d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gamestate/cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,14 @@ void c_toggle_core(sys::state& state, dcon::nation_id source, dcon::province_id
add_to_command_queue(state, p);
}
void execute_c_toggle_core(sys::state& state, dcon::nation_id source, dcon::province_id p, dcon::nation_id n) {
auto const nid = state.world.nation_get_identity_from_identity_holder(n);
for(const auto a : state.world.province_get_core(p)) {
if(a.get_identity().get_nation_from_identity_holder() == n) {
province::remove_core(state, p, a.get_identity());
if(a.get_identity() == nid) {
province::remove_core(state, p, nid);
return; //early exit
}
}
province::add_core(state, p, state.world.nation_get_identity_from_identity_holder(n));
province::add_core(state, p, nid);
}

}

0 comments on commit 025eb6d

Please sign in to comment.