the switch fix keeps reverting itself and it's so fucking annoying

This commit is contained in:
An Orbit 2023-05-08 11:30:05 -04:00 committed by GitHub
parent 67353e74a4
commit 26980c584a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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