From 1ae02a4328e66afe3077eb68bbb0a845b5a81eea Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Thu, 8 Oct 2020 15:10:15 -0400 Subject: [PATCH] Fixed being able to buy more buyables than you should. --- changelog.md | 5 +++++ js/game.js | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/changelog.md b/changelog.md index ab396df..e0891f3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ #The Modding Tree changelog: + +##v1.3.4: 10/8/20 +- Added "midsection" feature to add things to a tab's layout while still keeping the standard layout. +- Fix for being able to buy more buyables than you should. + ##v1.3.3: - 10/7/20 - Fix for the "order of operations" issue in temp. diff --git a/js/game.js b/js/game.js index a1c10b0..e34d7da 100644 --- a/js/game.js +++ b/js/game.js @@ -229,6 +229,7 @@ function respecBuyables(layer) { if (!layers[layer].buyables.respec) return if (!confirm("Are you sure you want to respec? This will force you to do a \"" + (layers[layer].name ? layers[layer].name : layer) + "\" reset as well!")) return layers[layer].buyables.respec() + updateBuyableTemp(layer) } function canAffordUpg(layer, id) { @@ -305,12 +306,23 @@ function buyUpg(layer, id) { upg.onPurchase() } +function buyMaxBuyable(layer, id) { + if (!player[layer].unl) return + if (!tmp.buyables[layer][id].unl) return + if (!tmp.buyables[layer][id].canAfford) return + if (!layers[layer].buyables[id].buyMax) return + + layers[layer].buyables[id].buyMax() + updateBuyableTemp(layer) +} + function buyBuyable(layer, id) { if (!player[layer].unl) return if (!tmp.buyables[layer][id].unl) return if (!tmp.buyables[layer][id].canAfford) return layers[layer].buyables[id].buy() + updateBuyableTemp(layer) } function resetRow(row) {