From 05062c5dae5b1d400ed4c51e8f2da578c1e4bf6b Mon Sep 17 00:00:00 2001 From: choelzl Date: Wed, 9 Feb 2022 21:58:48 +0100 Subject: [PATCH] WIP --- twitch/chatguessr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twitch/chatguessr.js b/twitch/chatguessr.js index 8767e39..77a3d4a 100644 --- a/twitch/chatguessr.js +++ b/twitch/chatguessr.js @@ -92,12 +92,12 @@ function addGuess(user,position) { if(seed.round == undefined) return; - var current_round = ""+seed.round; + var current_round = ""+(seed.round-1); if(guesses[current_round]==undefined) guesses[current_round] = [] if(guesses[current_round].some((v)=>v.user==user)) return; if(!isCoordinates(position)) return; var pos = toPos(position) - var distance = haversineDistance(pos, {lat:seed.rounds[current_round].lat,lng:seed.rounds[current_round].lng}) + var distance = haversineDistance(pos, {lat: seed.rounds[current_round].lat, lng: seed.rounds[current_round].lng}) var score = calculateScore(distance, scale) guesses[current_round].push({