1
0

Fix longest road selection

Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
James Ketrenos 2022-03-13 16:15:03 -07:00
parent 022697a106
commit b6bd8dfebf

View File

@ -1297,7 +1297,7 @@ const calculateRoadLengths = (game, session) => {
continue; continue;
} }
if (player.longestRoad > longestRoad) { if (player.longestRoad > longestRoad) {
longestPlayers = [ key ]; longestPlayers = [ player ];
longestRoad = player.longestRoad; longestRoad = player.longestRoad;
} else if (game.players[key].longestRoad === longestRoad) { } else if (game.players[key].longestRoad === longestRoad) {
if (longestRoad >= 5) { if (longestRoad >= 5) {
@ -1306,7 +1306,7 @@ const calculateRoadLengths = (game, session) => {
} }
} }
if (debug.road) console.log({ longestPlayers }); console.log({ longestPlayers });
if (longestPlayers.length > 0) { if (longestPlayers.length > 0) {
if (longestPlayers.length === 1) { if (longestPlayers.length === 1) {