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:
parent
45ebf4c002
commit
1ae02a4328
2 changed files with 17 additions and 0 deletions
|
@ -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.
|
||||
|
||||
|
|
12
js/game.js
12
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) {
|
||||
|
|
Loading…
Reference in a new issue