1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-05-11 20:41:10 +00:00
This commit is contained in:
Acamaeda 2020-09-29 19:47:47 -04:00
parent b20e35919e
commit 0b50935be1
2 changed files with 14 additions and 12 deletions

View file

@ -99,13 +99,14 @@ function exportSave() {
document.body.removeChild(el);
}
function importSave(imported=undefined) {
function importSave(imported=undefined, forced=false) {
if (imported===undefined) imported = prompt("Paste your save here")
try {
tempPlr = Object.assign(getStartPlayer(), JSON.parse(atob(imported)))
if(tempPlr.versionType != "Modding") // Wrong save
if(tempPlr.versionType != modInfo.id && !forced) // Wrong save (use "Forced" to force it to accept.)
return
player = tempPlr;
player.versionType = modInfo.id
fixSave()
save()
window.location.reload()