This commit is contained in:
An Orbit 2023-04-19 20:12:37 -04:00 committed by GitHub
parent 65a1c2f4b7
commit 216ec64495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -1,8 +1,9 @@
var modName = "mods/save_loading.js"; var modName = "mods/save_loading.js";
try { try {
rebuildCurrentPixels ??= function() { if(typeof(rebuildCurrentPixels) !== "function") {
var currPix = []; //rebuild currentPixels from pixelMap to try to fix bug rebuildCurrentPixels = function() {
var currPix = []; //rebuild currentPixels from pixelMap to try to fix bug
for(pmi = 0; pmi < pixelMap.length; pmi++) { for(pmi = 0; pmi < pixelMap.length; pmi++) {
var pixelMapPart = pixelMap[pmi]; var pixelMapPart = pixelMap[pmi];
for(pmj = 0; pmj < pixelMapPart.length; pmj++) { for(pmj = 0; pmj < pixelMapPart.length; pmj++) {
@ -15,6 +16,7 @@ try {
}; };
}; };
currentPixels = currPix; currentPixels = currPix;
};
}; };
//https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API //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): <input id="pixelSize"> (Use if the save looks cut o
}); });
} catch (error) { } catch (error) {
alert(`save_loading error: ${error.message}`); alert(`save_loading error: ${error.toString()}`);
}; };