From 143d3920f68a01ad062865a65438923e68322a1b Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 2 Jan 2024 16:28:59 +0100 Subject: Give win to all opponents when resigning (or timing out). --- server.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server.js') 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" -- cgit v1.2.3