From 26980c584aafafddee23e7f0e1fb21bb4ba57c67 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 8 May 2023 11:30:05 -0400 Subject: [PATCH] the switch fix keeps reverting itself and it's so fucking annoying --- mods/doElectricity changes.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mods/doElectricity changes.js b/mods/doElectricity changes.js index df3d3d0a..5bb17b70 100644 --- a/mods/doElectricity changes.js +++ b/mods/doElectricity changes.js @@ -13,8 +13,7 @@ function doElectricity(pixel) { var newPixel = pixelMap[x][y]; var con = elements[newPixel.element].conduct; if (con == undefined) {continue} - var info = elements[pixel.element]; - if (info.noConduct && info.noConduct.includes(newPixel.element)) {continue}; + if (elements[pixel.element].noConduct?.length && elements[pixel.element].noConduct.includes(newPixel.element)) {continue}; if (Math.random() < con) { // If random number is less than conductivity if (!newPixel.charge && !newPixel.chargeCD) { newPixel.charge = isNaN(pixel.charge) ? 0 : pixel.charge; //Actually set it to the same charge