mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-24 17:31:50 +00:00
Fixed reactivity on reset
This commit is contained in:
parent
2a4612c8ec
commit
b7c7317876
2 changed files with 8 additions and 1 deletions
|
@ -109,7 +109,7 @@ function layerDataReset(layer, keep = []) {
|
|||
storedData[keep[thing]] = player[layer][keep[thing]]
|
||||
}
|
||||
|
||||
player[layer] = layers[layer].startData();
|
||||
layOver(player[layer], layers[layer].startData());
|
||||
player[layer].upgrades = []
|
||||
player[layer].milestones = []
|
||||
player[layer].challenges = getStartChallenges(layer)
|
||||
|
|
|
@ -612,6 +612,13 @@ function goBack() {
|
|||
else showTab(player.lastSafeTab)
|
||||
}
|
||||
|
||||
function layOver(obj1, obj2) {
|
||||
for (let x in obj2) {
|
||||
if (obj2[x] instanceof Object) layOver(obj1[x], obj2[x]);
|
||||
else obj1[x] = obj2[x];
|
||||
}
|
||||
}
|
||||
|
||||
function notifyLayer(name) {
|
||||
if (player.tab == name || !layerunlocked(name)) return
|
||||
player.notify[name] = 1
|
||||
|
|
Loading…
Reference in a new issue