From 7c3e23a7619483e04928749f25b8cd9fb3876c10 Mon Sep 17 00:00:00 2001 From: "Laetitia (O-01-67)" <68935009+O-01-67@users.noreply.github.com> Date: Tue, 14 Feb 2023 12:30:57 -0500 Subject: [PATCH] fix name conflict with vanilla saveSettings() --- mods/save_loading.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/save_loading.js b/mods/save_loading.js index 7e0a28fc..e020fb34 100644 --- a/mods/save_loading.js +++ b/mods/save_loading.js @@ -5,11 +5,11 @@ function zeroToNull(val) { return val; }; -if(!localStorage.saveSettings) { - localStorage.setItem("saveSettings", '{"shortenNulls":false,"roundTemps":true}'); +if(!localStorage.slSaveSettings) { + localStorage.setItem("slSaveSettings", '{"shortenNulls":false,"roundTemps":true}'); }; -saveSettings = JSON.parse(localStorage.saveSettings); +slSaveSettings = JSON.parse(localStorage.slSaveSettings); function epsilonRound(num,precision) { return Math.round((num + Number.EPSILON) * (10 ** precision)) / (10 ** precision); @@ -26,7 +26,7 @@ function getSimulationState() { version: 1, enabledMods: localStorage.enabledMods, }; - nulls: if(saveSettings.shortenNulls) { + nulls: if(slSaveSettings.shortenNulls) { if(!structuredClone) { alert("Your browser does not support structuredClone, which is needed to shorten nulls to zeroes without corrupting the current pixelMap."); console.error("shortenNulls: structuredClone not supported"); @@ -41,7 +41,7 @@ function getSimulationState() { }; }; }; - if(saveSettings.roundTemps) { + if(slSaveSettings.roundTemps) { for(i = 0; i < simulationState.pixelMap.length; i++) { var column = simulationState.pixelMap[i]; for(j = 0; j < column.length; j++) {