summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-04-03 07:54:33 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2025-04-03 07:54:33 -0400
commit6651c5256a3d01deb20c8036adcc3d847d4010d2 (patch)
tree69b6a9e94a6b25aa56782be39a0815b99e950157 /rules.js
parent275d97d918cec9664b16a03889dff4c794ed8a0b (diff)
downloadvijayanagara-6651c5256a3d01deb20c8036adcc3d847d4010d2.tar.gz
Fuzzy bug campaign set
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files 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()