MAPG-235 fix loading other players' history and calculating final score

This commit is contained in:
Balázs Vigh 2021-05-21 15:40:43 +02:00
parent 4520d11559
commit 636c47366a

View File

@ -412,6 +412,7 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 });
}
Game.rounds = [];
Game.scoreSum = 0;
for (var i = 0; i < Game.history.length; ++i) {
var round = Game.history[i];
@ -682,7 +683,7 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 });
return;
}
Game.history = this.response.history;
Game.loadHistory(this.response.history);
Game.restrictions = this.response.restrictions;
Game.receiveResult(this.response.position, guessPosition, this.response.result, this.response.allResults);