From 6651c5256a3d01deb20c8036adcc3d847d4010d2 Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Thu, 3 Apr 2025 07:54:33 -0400 Subject: Fuzzy bug campaign set --- rules.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rules.js b/rules.js index 8a289da..e78b17d 100644 --- a/rules.js +++ b/rules.js @@ -2106,8 +2106,9 @@ function is_n_from_warangal(n, s) { return true } else if (path.length < n) { for (let neighbor of SPACES[node].adjacent) { - if (!set_has(path, neighbor) && !set_has(game.decree.campaign, neighbor)) { - queue.push([neighbor, [...path, neighbor]]); + // if (!set_has(path, neighbor) && !set_has(game.decree.campaign, neighbor)) { + if (!set_has(path, neighbor) && !game.decree.campaign.includes(neighbor)) { + queue.push([neighbor, [...path, neighbor]]); } } } @@ -2763,6 +2764,8 @@ states.plunder_remove = { function end_plunder() { if (game.summary && game.summary.length > 0) { pop_summary() + } else if (game.summary) { + game.summary = null } let n = count_pieces(game.cmd.where, MI, TROOPS) - 3 @@ -5564,9 +5567,9 @@ states.vm_conspire_trade = { states.vm_govern_attack_demand = { prompt() { event_prompt("Govern, Attack or Demande Obedience in selected Province.") - view.actions.govern = can_govern() ? 1 : 0 - view.actions.attack = can_attack() ? 1 : 0 - view.actions.demand = can_demand() ? 1 : 0 + view.actions.govern = can_govern() && can_govern_in_space(game.vm.s) ? 1 : 0 + view.actions.attack = can_attack() && can_attack_in_space(game.vm.s) ? 1 : 0 + view.actions.demand = can_demand() && can_demand_in_space(game.vm.s) ? 1 : 0 }, govern() { push_undo() -- cgit v1.2.3