From fc18275f8c4234188037f98e31d72c46519ec6bf Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Sun, 27 Sep 2020 16:21:14 -0400 Subject: [PATCH] Fixed a bug with layers without a "best" value tried to update it --- js/game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/game.js b/js/game.js index d49a391..43d5fdd 100644 --- a/js/game.js +++ b/js/game.js @@ -277,7 +277,7 @@ function fullLayerReset(layer) { function addPoints(layer, gain) { player[layer].points = player[layer].points.add(gain).max(0) - player[layer].best = player[layer].best.max(player[layer].points) + if (player[layer].best) player[layer].best = player[layer].best.max(player[layer].points) if (player[layer].total) player[layer].total = player[layer].total.add(gain) }