1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-24 17:31:50 +00:00

Fixed being able to buy more buyables than you should.

This commit is contained in:
Acamaeda 2020-10-08 15:10:15 -04:00
parent 45ebf4c002
commit 1ae02a4328
2 changed files with 17 additions and 0 deletions

View file

@ -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.

View file

@ -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) {