From 437f4313cefd4608cb8985fddc57321857dd8944 Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Sat, 12 Dec 2020 23:32:55 -0500 Subject: [PATCH] Made things more backwards-compatible --- js/game.js | 8 ++++---- js/technical/systemComponents.js | 2 +- js/utils.js | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/game.js b/js/game.js index a9b4933..327e3cb 100644 --- a/js/game.js +++ b/js/game.js @@ -94,7 +94,7 @@ function canReset(layer) if(tmp[layer].type == "none") return false else - return run(layers[layer].canReset, tmp[layer]) + return run(layers[layer].canReset, layers[layer]) } function rowReset(row, layer) { @@ -102,7 +102,7 @@ function rowReset(row, layer) { if(layers[lr].doReset) { player[lr].activeChallenge = null // Exit challenges on any row reset on an equal or higher row - run(layers[lr].doReset, tmp[lr], layer) + run(layers[lr].doReset, layers[lr], layer) } else if(tmp[layer].row > tmp[lr].row && row !== "side" && !isNaN(row)) layerDataReset(lr) @@ -164,7 +164,7 @@ function doReset(layer, force=false) { } if (layers[layer].onPrestige) - run(layers[layer].onPrestige, tmp[layer], gain) + run(layers[layer].onPrestige, layers[layer], gain) addPoints(layer, gain) updateMilestones(layer) @@ -268,7 +268,7 @@ function completeChallenge(layer, x) { if (player[layer].challenges[x] < tmp[layer].challenges[x].completionLimit) { needCanvasUpdate = true player[layer].challenges[x] += 1 - if (layers[layer].challenges[x].onComplete) run(layers[layer].challenges[x].onComplete, tmp[layer].challenges[x]) + if (layers[layer].challenges[x].onComplete) run(layers[layer].challenges[x].onComplete, layers[layer].challenges[x]) } player[layer].activeChallenge = null updateChallengeTemp(layer) diff --git a/js/technical/systemComponents.js b/js/technical/systemComponents.js index 6087808..be8f01b 100644 --- a/js/technical/systemComponents.js +++ b/js/technical/systemComponents.js @@ -18,7 +18,7 @@ var systemComponents = { v-bind:id="layer" v-on:click="function() { if(tmp[layer].isLayer) {showTab(layer)} - else {run(layers[layer].onClick, tmp[layer])} + else {run(layers[layer].onClick, layers[layer])} }" v-bind:tooltip="(tmp[layer].tooltip == '') ? false : (tmp[layer].isLayer) ? ( diff --git a/js/utils.js b/js/utils.js index 4664d78..efa86c5 100644 --- a/js/utils.js +++ b/js/utils.js @@ -454,7 +454,7 @@ function respecBuyables(layer) { if (!layers[layer].buyables) return if (!layers[layer].buyables.respec) return if (!confirm("Are you sure you want to respec? This will force you to do a \"" + (tmp[layer].name ? tmp[layer].name : layer) + "\" reset as well!")) return - run(layers[layer].buyables.respec, tmp[layer].buyables) + run(layers[layer].buyables.respec, layers[layer].buyables) updateBuyableTemp(layer) document.activeElement.blur() } @@ -559,7 +559,7 @@ function buyUpg(layer, id) { if (upg.canAfford === false) return let pay = layers[layer].upgrades[id].pay if (pay !== undefined) - run(pay, upg) + run(pay, layers[layer].upgrades[id]) else { let cost = tmp[layer].upgrades[id].cost @@ -596,7 +596,7 @@ function buyMaxBuyable(layer, id) { if (!tmp[layer].buyables[id].canAfford) return if (!layers[layer].buyables[id].buyMax) return - run(layers[layer].buyables[id].buyMax, tmp[layer].buyables[id]) + run(layers[layer].buyables[id].buyMax, layers[layer].buyables[id]) updateBuyableTemp(layer) } @@ -605,7 +605,7 @@ function buyBuyable(layer, id) { if (!tmp[layer].buyables[id].unlocked) return if (!tmp[layer].buyables[id].canAfford) return - run(layers[layer].buyables[id].buy, tmp[layer].buyables[id]) + run(layers[layer].buyables[id].buy, layers[layer].buyables[id]) updateBuyableTemp(layer) } @@ -614,7 +614,7 @@ function clickClickable(layer, id) { if (!tmp[layer].clickables[id].unlocked) return if (!tmp[layer].clickables[id].canClick) return - run(layers[layer].clickables[id].onClick, tmp[layer].clickables[id]) + run(layers[layer].clickables[id].onClick, layers[layer].clickables[id]) updateClickableTemp(layer) }