diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-11-30 13:17:30 +0100 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-11-30 13:17:30 +0100 |
commit | 3ebff0057e4a8d3f611c0e59f22ce870bd038661 (patch) | |
tree | 52dddb08cd7bc19d5f5efde7a793b142e8c9c1ae | |
parent | 3da7ea2f6eea3aef97ff54f7082d82c395509292 (diff) | |
download | votes-for-women-3ebff0057e4a8d3f611c0e59f22ce870bd038661.tar.gz |
remove all other states from eligible list when we reached our limit
-rw-r--r-- | rules.js | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) |