WIP
This commit is contained in:
parent
ef373eb88e
commit
05062c5dae
@ -92,12 +92,12 @@
|
|||||||
|
|
||||||
function addGuess(user,position) {
|
function addGuess(user,position) {
|
||||||
if(seed.round == undefined) return;
|
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]==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;
|
||||||
var pos = toPos(position)
|
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)
|
var score = calculateScore(distance, scale)
|
||||||
guesses[current_round].push({
|
guesses[current_round].push({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user