summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-30 13:17:30 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-30 13:17:30 +0100
commit3ebff0057e4a8d3f611c0e59f22ce870bd038661 (patch)
tree52dddb08cd7bc19d5f5efde7a793b142e8c9c1ae
parent3da7ea2f6eea3aef97ff54f7082d82c395509292 (diff)
downloadvotes-for-women-3ebff0057e4a8d3f611c0e59f22ce870bd038661.tar.gz
remove all other states from eligible list when we reached our limit
-rw-r--r--rules.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 0cf1150..f22c790 100644
--- a/rules.js
+++ b/rules.js
@@ -2535,6 +2535,11 @@ function after_vm_remove_cube(us_state) {
map_incr(game.vm.removed, us_state, 1)
if (game.vm.all) {
+ if (map_key_count(game.vm.removed) === game.vm.limit) {
+ // remove all other states from eligible list when we reached our limit
+ set_filter(game.vm.us_states, s => map_has(game.vm.removed, s))
+ }
+
if (!color_cubes(game.vm.cubes, us_state)) {
set_delete(game.vm.us_states, us_state)