fix missing stateLow

also changes to breakPixel replicated in mobs.js
This commit is contained in:
Laetitia (O-01-67) 2022-11-06 11:42:19 -05:00 committed by GitHub
parent 3c20716991
commit 5de0a1687f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -15,10 +15,13 @@ function hasPixel(x,y,elementInput) {
}; };
}; };
function breakPixel(pixel,changetemp=false) { function breakPixel(pixel,changetemp=false,defaultBreakIntoDust=false) {
var info = elements[pixel.element]; var info = elements[pixel.element];
if(typeof(info.breakInto) === "undefined") { if(typeof(info.breakInto) === "undefined") {
return false; if(defaultBreakIntoDust) {
if(Math.random() < defaultBreakIntoDust) { changePixel(pixel,"dust",changetemp) };
};
return defaultBreakIntoDust;
}; };
var breakIntoElement = info.breakInto; var breakIntoElement = info.breakInto;
if(Array.isArray(breakIntoElement)) { if(Array.isArray(breakIntoElement)) {
@ -61,6 +64,7 @@ if(enabledMods.includes(onTryMoveIntoMod)) {
tempHigh: 100, tempHigh: 100,
stateHigh: "cooked_meat", stateHigh: "cooked_meat",
tempLow: -18, tempLow: -18,
stateLow: "frozen_meat",
category:"life", category:"life",
hidden: true, hidden: true,
breakInto: ["meat", "blood"], breakInto: ["meat", "blood"],