summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'server.js')
-rw-r--r--server.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/server.js b/server.js
index feb06ca..4145b43 100644
--- a/server.js
+++ b/server.js
@@ -1015,12 +1015,17 @@ function format_options(options) {
function annotate_game(game, user_id) {
let players = SQL_SELECT_PLAYERS_JOIN.all(game.game_id)
let options = JSON.parse(game.options)
+ let roles = get_game_roles(game.title_id, game.scenario, options)
if (game.options === '{}')
game.human_options = "None"
else
game.human_options = format_options(options)
+ for (let i = 0; i < players.length; ++i)
+ players[i].index = roles.indexOf(players[i].role)
+ players.sort((a, b) => a.index - b.index)
+
game.is_ready = is_game_ready(game.title_id, game.scenario, options, players)
let your_count = 0