fix save loading when save doesn't exist
will need to figure out how to test this but it should work Signed-off-by: nif <nif@incremental.social>
This commit is contained in:
parent
9ca5fb3399
commit
ed8777f56f
1 changed files with 277 additions and 277 deletions
8
main.js
8
main.js
|
@ -209,13 +209,13 @@ document.getElementById("wipe-game").addEventListener("click", () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
{
|
try {
|
||||||
let falsePlayer = JSON.parse(atob(localStorage.getItem("nif's-infinite-generators")))
|
let falsePlayer = JSON.parse(atob(localStorage.getItem("nif's-infinite-generators")))
|
||||||
player = {...player, ...falsePlayer}
|
player = {...player, ...falsePlayer}
|
||||||
player.unlocked = {...player.unlocked, ...falsePlayer.unlocked}
|
if (falsePlayer.unlocked) player.unlocked = {...player.unlocked, ...falsePlayer.unlocked}
|
||||||
player.cupgs = [...player.cupgs, ...falsePlayer.cupgs]
|
if (falsePlayer.cupgs) player.cupgs = [...player.cupgs, ...falsePlayer.cupgs]
|
||||||
for (const i in player.gens) newGenerator(Number(i))
|
for (const i in player.gens) newGenerator(Number(i))
|
||||||
}
|
} catch (TypeError) {}
|
||||||
|
|
||||||
function updateVars() {
|
function updateVars() {
|
||||||
const dt = 0.05
|
const dt = 0.05
|
||||||
|
|
Loading…
Reference in a new issue