summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-17 10:53:23 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-17 10:53:23 +0200
commit1a19cf4334cbe2eeb17fde78028b76e20d5afdd1 (patch)
tree6a505ad07e41174b7ee10d73f7c45cdcb8485639
parentb97b42328029109190a7ade03753a35e7abbbcbc (diff)
downloadplantagenet-1a19cf4334cbe2eeb17fde78028b76e20d5afdd1.tar.gz
Fix count_deplete.
-rw-r--r--rules.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index 359a203..4ce2ad6 100644
--- a/rules.js
+++ b/rules.js
@@ -9286,19 +9286,18 @@ function deplete_merchants() {
}
function count_deplete(loc) {
- game.count = 0
+ let n = 0
for (let next of data.locales[loc].adjacent) {
if (has_exhausted_marker(next) || has_depleted_marker(next)) {
- ++game.count
+ ++n
}
}
if (has_exhausted_marker(loc) || has_depleted_marker(loc)) {
- ++game.count
+ ++n
}
- if (game.count > 1)
- return game.count = 2
- else
- return game.count
+ if (n > 1)
+ n = 2
+ return n
}
// === CAPABILITY: BURGUNDIANS ===