summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-01-02 16:28:59 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-28 13:50:27 +0100
commit143d3920f68a01ad062865a65438923e68322a1b (patch)
treea0702dc5fc880fc5b173b8020b91f23d9e04b820 /server.js
parent28cbf913f44014585768d4f338fc62d4e3dfccc1 (diff)
downloadserver-143d3920f68a01ad062865a65438923e68322a1b.tar.gz
Give win to all opponents when resigning (or timing out).
Diffstat (limited to 'server.js')
-rw-r--r--server.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/server.js b/server.js
index 69b3162..132c1cd 100644
--- a/server.js
+++ b/server.js
@@ -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"