Compare commits

...

1 Commits

Author SHA1 Message Date
Laetitia (O-01-67) f690d8e21f
Prevent deletePixel splicing of index -1 as a cause of ghost pixels
when this happens, pixels are "deleted" starting from the newest pixel created and become ghost pixels present in pixelMap but not currentPixels (in worldgen worlds, this manifests as the pixels disappearing from the upwards and leftwards from the bottom right)
2022-12-13 12:14:56 -05:00
1 changed files with 1 additions and 1 deletions

View File

@ -7000,7 +7000,7 @@
}
function deletePixel(x,y) {
// remove pixelMap[x][y] from currentPixels
currentPixels.splice(currentPixels.indexOf(pixelMap[x][y]),1);
if(currentPixels.indexOf(pixelMap[x][y]) !== -1) { currentPixels.splice(currentPixels.indexOf(pixelMap[x][y]),1) };
if (pixelMap[x][y]) {pixelMap[x][y].del = true;}
delete pixelMap[x][y];
/*for (var i = 0; i < currentPixels.length; i++) {