X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=67af3b9ff306d7ec4af666738b537035a97a2d7e;hp=f00dc92b298efc8ab91e3c958daf7a3260e28b38;hb=3d55deea9a2011c38d8d0067bd57fc889958bec2;hpb=dce792f64ab0a311d348a6eb05c440dd1b170bd3 diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index f00dc92b..67af3b9f 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -319,7 +319,12 @@ export default { // TODO: compute clocks + initime } const tc = extractTime(game.timeControl); - const myIdx = game.players.findIndex(p => p.sid == this.st.user.sid); + // TODO: this is not really beautiful (uid on corr players...) + if (gtype == "corr" && game.players[0].color == "b") + [ game.players[0], game.players[1] ] = [ game.players[1], game.players[0] ]; + const myIdx = game.players.findIndex(p => { + return p.sid == this.st.user.sid || p.uid == this.st.user.id; + }); if (game.clocks[0] < 0) //game unstarted { game.clocks = [tc.mainTime, tc.mainTime];