Parcourir la source

Fix rank change announcements

Clément Wolf il y a 5 mois
Parent
commit
11c0baaab4
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      elo.js

+ 1 - 0
elo.js

@@ -181,6 +181,7 @@ async function save_game_and_update_rating(lobby, game) {
       const direction = (RANK_DIVISIONS.indexOf(new_rank_text) > RANK_DIVISIONS.indexOf(old_rank_text)) ? '▲' : '▼';
       rank_changes.push(`${player.username} [${user_page} ${direction} ${new_rank_text} ]`);
       db.prepare(`UPDATE rating SET division = ? WHERE user_id = ? AND mode = ?`).run(new_rank_text, player.user_id, game.mode_int);
+      player.ratings[game.mode_int].division = new_rank_text;
     }
   }