From bdbd53895c57a715bfe2636a1c83126b6785c43c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 9 Nov 2024 13:55:18 +0100 Subject: fix retroactive conquest for austria/pragmatic --- rules.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index c36946d..06ef801 100644 --- a/rules.js +++ b/rules.js @@ -2545,7 +2545,7 @@ states.movement = { else if (game.power === P_AUSTRIA && has_unmoved_piece(P_PRAGMATIC)) gen_action_power(P_PRAGMATIC) else - view.actions.end_movement = 0 + view.actions.end_movement = DEBUG } } else { if (!has_unmoved_piece(game.power)) @@ -4328,7 +4328,7 @@ function goto_retroactive_conquest() { let conq = [] map_for_each(game.retro, function (s, pow) { - if (is_enemy_controlled_fortress(s)) { + if (pow === game.power && is_enemy_controlled_fortress(s)) { if (!is_protected_from_conquest(s)) { set_control_of_fortress(s, pow) conq.push(s) @@ -4336,9 +4336,12 @@ function goto_retroactive_conquest() { } }) - log_conquest(conq) + // TODO: map_filter + for (let i = 0; i < game.retro.length; i += 2) + if (game.retro[i+1] === game.power) + array_remove_pair(game.retro, i) - map_clear(game.retro) + log_conquest(conq) next_sequence_of_play() } -- cgit v1.2.3