diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-01-02 16:28:59 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-28 13:50:27 +0100 |
commit | 143d3920f68a01ad062865a65438923e68322a1b (patch) | |
tree | a0702dc5fc880fc5b173b8020b91f23d9e04b820 | |
parent | 28cbf913f44014585768d4f338fc62d4e3dfccc1 (diff) | |
download | server-143d3920f68a01ad062865a65438923e68322a1b.tar.gz |
Give win to all opponents when resigning (or timing out).
-rw-r--r-- | server.js | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -2603,13 +2603,13 @@ function do_resign(game_id, role, how) { let result = "None" + let roles = get_game_roles(game.title_id, game.scenario, parse_game_options(game.options)) if (game.player_count === 2) { - if (game.moves > 6) { - let roles = get_game_roles(game.title_id, game.scenario, parse_game_options(game.options)) - for (let r of roles) - if (r !== role) - result = r - } + for (let r of roles) + if (r !== role) + result = r + } else { + result = roles.filter(r => r !== role).join(", ") } state.state = "game_over" |