From 45d8c773ee1ab12f7c2983287098b9080caf0079 Mon Sep 17 00:00:00 2001 From: "Laetitia (O-01-67)" <68935009+O-01-67@users.noreply.github.com> Date: Sun, 12 Feb 2023 10:43:25 -0500 Subject: [PATCH] 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 --- mods/changePixelDebug.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 mods/changePixelDebug.js diff --git a/mods/changePixelDebug.js b/mods/changePixelDebug.js new file mode 100644 index 00000000..49b8553f --- /dev/null +++ b/mods/changePixelDebug.js @@ -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); +}; \ No newline at end of file