Closed MCArth closed 2 years ago
Hi, nice catch. The intent there was that remeshing isn't needed when a non-solid non-opaque object block changes into air, but I was only checking if the new block is terrain, and not the old.
I will replace it with something like:
var wasTerrain = (!objOld && (oldID !== 0))
var nowTerrain = (!objNew && (newID !== 0))
if (solidityChanged || opacityChanged || wasTerrain || nowTerrain) {
this._terrainDirty = true
}
ah yes, I don't have any opaque objects but that does make sense - looks good
Ok thanks! This is done and I'll push it soon.
Hi, I've encountered an issue when changing a chunk's block state (via setBlock) from a water block (neither solid nor opaque) to an air block (0)
The problem seems to be caused by this logic:
https://github.com/fenomas/noa/blob/d9fe5d1549bc4596c5756fdcac852c9b07e535f0/src/lib/chunk.js#L156
I've changed it to this:
as it seems to me the terrain has to be remeshed if a terrain id has changed, no matter what
It seems to work but maybe I'm missing something?