fixed liquids being visible in all views bug

This commit is contained in:
Nekonico 2025-02-26 17:09:54 -08:00 committed by GitHub
parent f5ebeeb4ac
commit 1f7a50409e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,8 @@ window.addEventListener('load', function() {
for (var element in elements) {
if (elements[element].state === "liquid" && elements[element].behavior != behaviors.MOLTEN) {
elements[element].renderer = function(pixel, ctx) { // this part used nouseramefounds code, props to him!
drawDefault(ctx,pixel);
if (!viewInfo[view].colorEffects) { return }
if (!pixel.rSeed){pixel.rSeed = [Math.random(), Math.random(), Math.random(), Math.random()]}
if (typeof pixel.color == "object"){
let selectedColor = pixel.color[Math.floor(pixel.rSeed[1]*elements[pixel.element].color.length)]
@ -45,7 +47,7 @@ window.addEventListener('load', function() {
if (element === "midas_touch" || element === "molasses" || element === "grease" || element === "oil" || element === "lamp_oil" || element === "nut_oil" || element === "honey" || element === "sap" || element === "caramel") {
elements[element].polar = 2
}
else if (element === "soap") {
else if (element === "soap" || element === "dye") {
elements[element].polar = 3
}
else {