This commit is contained in:
choelzl 2022-02-09 21:37:26 +01:00
parent b1e757d02c
commit 275c4772d0
Signed by: sora
GPG Key ID: A362EA0491E2EEA0

View File

@ -92,14 +92,14 @@
function addGuess(user,position) {
if(seed.round == undefined) return;
let current_round = ""+seed.round;
var current_round = ""+seed.round;
if(guesses[current_round]==undefined) guesses[current_round] = []
if(guesses[current_round].some((v)=>v.user==user)) return;
if(!isCoordinates(position)) return;
let pos = toPos(position)
let distance = haversineDistance(pos, {lat:seed.rounds[current_round].lat,lon:seed.rounds[current_round].lon})
var pos = toPos(position)
var distance = haversineDistance(pos, {lat:seed.rounds[current_round].lat,lon:seed.rounds[current_round].lon})
let score = calculateScore(distance, scale)
var score = calculateScore(distance, scale)
guesses[current_round].push({
user:user,
location:location,