diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-05-23 20:35:53 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:31:29 +0100 |
commit | 2fee35b82e3c9b593fa636a2971cd6197d2020b3 (patch) | |
tree | 74eb409feb5acc6f4f15be1e60cb790391968005 | |
parent | 61f109eb37d7fee9532d029ce9a3d111cc5cfd8a (diff) | |
download | pax-pamir-2fee35b82e3c9b593fa636a2971cd6197d2020b3.tar.gz |
Fix safe house iteration bug.
-rw-r--r-- | rules.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2181,15 +2181,15 @@ function check_safe_house() { function check_player_safe_house(p) { let x = player_cylinders(p); for (let i = x; i < x + 10; ++i) { - if (game.pieces[x] === Safe_House) { + if (game.pieces[i] === Safe_House) { if (player_has_safe_house(p)) { set_active(p); logbr(); game.state = 'safe_house'; - game.selected = x; + game.selected = i; return true; } else { - game.pieces[x] = 0; + game.pieces[i] = 0; } } } @@ -2208,7 +2208,7 @@ states.safe_house = { }, card(c) { push_undo(); - log(`${player_names[game.active]} spy to #{c}.`); + log(`${player_names[game.active]} spy to #${c}.`); game.pieces[game.selected] = c; game.selected = -1; check_safe_house(); |