From bf06ce401f25968798921af7d65cba634671004f Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Wed, 13 Oct 2021 10:18:48 +0000 Subject: [PATCH] aarex dimension: correctly subtract only cost, instead of set to 0 With a `sub()`, the number would get set to NaN, and so `sub().max(0)` sets to 0. This means buying a single dimension always sets dimension points to zero, which unnecessarily penalises buying a single dimension. Instead, the cost should be subtracted. --- js/layers/aarex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/layers/aarex.js b/js/layers/aarex.js index 902c4e8..91dbd41 100644 --- a/js/layers/aarex.js +++ b/js/layers/aarex.js @@ -726,7 +726,7 @@ addLayer("aar", { buy() { let i = this.id - 100 let cost = this.cost() - if (cost.lte("ee15")) player.aar.dimPoints = player.aar.dimPoints.sub().max(0) + if (cost.lte("ee15")) player.aar.dimPoints = player.aar.dimPoints.sub(cost).max(0) player[this.layer].buyables[this.id] = player[this.layer].buyables[this.id].add(1) player.aar.dims[i] = player.aar.dims[i].add(1) },