From 216ec644954b011f6a81382e5c932227ebd39c9c Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Wed, 19 Apr 2023 20:12:37 -0400 Subject: [PATCH] illogic? --- mods/save_loading.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/save_loading.js b/mods/save_loading.js index 999dcb7f..8fcab069 100644 --- a/mods/save_loading.js +++ b/mods/save_loading.js @@ -1,8 +1,9 @@ var modName = "mods/save_loading.js"; try { - rebuildCurrentPixels ??= function() { - var currPix = []; //rebuild currentPixels from pixelMap to try to fix bug + if(typeof(rebuildCurrentPixels) !== "function") { + rebuildCurrentPixels = function() { + var currPix = []; //rebuild currentPixels from pixelMap to try to fix bug for(pmi = 0; pmi < pixelMap.length; pmi++) { var pixelMapPart = pixelMap[pmi]; for(pmj = 0; pmj < pixelMapPart.length; pmj++) { @@ -15,6 +16,7 @@ try { }; }; currentPixels = currPix; + }; }; //https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API @@ -512,5 +514,5 @@ Pixel size (rendering only): (Use if the save looks cut o }); } catch (error) { - alert(`save_loading error: ${error.message}`); + alert(`save_loading error: ${error.toString()}`); };