From 87112d2b6ebe688edb6dbf448e087ddc032a45cb Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Mon, 10 Dec 2018 18:41:04 -0800 Subject: [PATCH] temporary support for checking nans on victory --- src/state/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/state/index.js b/src/state/index.js index c10d7c2..7e51c3c 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -470,7 +470,8 @@ AFRAME.registerState({ // Percentage is score divided by total possible score. const accuracy = (state.score.score / (state.challenge.numBeats * 110)) * 100; - state.score.accuracy = accuracy; + state.score.accuracy = isNaN(accuracy) ? 0 : accuracy; + state.score.score = isNaN(state.score.score) ? 0 : state.score.score; if (accuracy >= 95) { state.score.rank = 'S';