changePixel warns you when an attempt is made to change to a nonexistent element

hopefully instead of shitting itself and dying with the blank screen
This commit is contained in:
Laetitia (O-01-67) 2023-02-12 10:43:25 -05:00 committed by GitHub
parent be7236a9b6
commit 45d8c773ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

9
mods/changePixelDebug.js Normal file
View File

@ -0,0 +1,9 @@
doLog = true;
oldChangePixel = changePixel;
function changePixel(pixel,element,changetemp=true) {
if(!elements[element]) {
if(doLog) { console.error(`Something tried to change a pixel (${pixel.x},${pixel.y}) to nonexistent element "${element}"`) };
};
return false;
changePixel(pixel,element,changetemp);
};