another error prevention if-block
This commit is contained in:
parent
670abff7c9
commit
8f6c8ef3d8
|
|
@ -429,7 +429,10 @@ if(enabledMods.includes(onTryMoveIntoMod)) {
|
||||||
};
|
};
|
||||||
pixel.dirLocked = true;
|
pixel.dirLocked = true;
|
||||||
} else if(Object.keys(badPixels).includes(newElement)) {
|
} else if(Object.keys(badPixels).includes(newElement)) {
|
||||||
body.dir = -1; //flip dir
|
if(hasPixel(pX,pY+1,"body")) {
|
||||||
|
var body = pixelMap[pX][pY+1];
|
||||||
|
body.dir = -1; //run away
|
||||||
|
};
|
||||||
if(Math.random() > badPixels[newElement].panicIncreaseChance) {
|
if(Math.random() > badPixels[newElement].panicIncreaseChance) {
|
||||||
pixel.panic += badPixels[newElement].panicIncrease;
|
pixel.panic += badPixels[newElement].panicIncrease;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue