WIP
This commit is contained in:
parent
b1e757d02c
commit
275c4772d0
@ -92,14 +92,14 @@
|
|||||||
|
|
||||||
function addGuess(user,position) {
|
function addGuess(user,position) {
|
||||||
if(seed.round == undefined) return;
|
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]==undefined) guesses[current_round] = []
|
||||||
if(guesses[current_round].some((v)=>v.user==user)) return;
|
if(guesses[current_round].some((v)=>v.user==user)) return;
|
||||||
if(!isCoordinates(position)) return;
|
if(!isCoordinates(position)) return;
|
||||||
let pos = toPos(position)
|
var pos = toPos(position)
|
||||||
let distance = haversineDistance(pos, {lat:seed.rounds[current_round].lat,lon:seed.rounds[current_round].lon})
|
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({
|
guesses[current_round].push({
|
||||||
user:user,
|
user:user,
|
||||||
location:location,
|
location:location,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user