From 2597a9ae30075965f5022e77aa3a44a898a3e092 Mon Sep 17 00:00:00 2001 From: choelzl Date: Mon, 14 Feb 2022 16:53:30 +0100 Subject: [PATCH] WIP --- twitch/chatguessr.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/twitch/chatguessr.js b/twitch/chatguessr.js index ee4c843..16bf58e 100644 --- a/twitch/chatguessr.js +++ b/twitch/chatguessr.js @@ -153,17 +153,19 @@ $.setIniDbBoolean('chatguessr', 'isOpen',false) //NEW ROUND /Score var gp = newseed.player.guesses[seed.round - 1].lat+","+newseed.player.guesses[seed.round - 1].lng addGuess($.channelName,gp); + }else if(newseed.state=="finished" && newseed.player.guesses.length > seed.player.guesses.length){ + $.setIniDbBoolean('chatguessr', 'isOpen',false) + var gp = newseed.player.guesses[newseed.round - 1].lat+","+newseed.player.guesses[newseed.round - 1].lng + addGuess($.channelName,gp); + }else if(newseed.state=="finished"){ + $.setIniDbBoolean('chatguessr', 'isOpen',false) //FINISHED + //Compute total scores + give reward + seed = newseed; + sendGuessData(); }else{ - if(newseed.state=="finished"){ - $.setIniDbBoolean('chatguessr', 'isOpen',false) //FINISHED - //Compute total scores + give reward - seed = newseed; - sendGuessData(); - }else{ - $.setIniDbBoolean('chatguessr', 'isOpen',true) //NEW ROUD /Guess - guesses.round = seed.round - 1; - sendGuessData(); - } + $.setIniDbBoolean('chatguessr', 'isOpen',true) //NEW ROUD /Guess + guesses.round = seed.round - 1; + sendGuessData(); } seed = newseed; }else if(action.equalsIgnoreCase('gg')){