fix some block render glitches

This commit is contained in:
onezplpl 2024-07-18 14:48:06 -04:00
parent ed720e0ea0
commit 328be44ed0
No known key found for this signature in database
GPG key ID: 7EC026A136F9EEC3

View file

@ -136,13 +136,12 @@ void cubes_free() { free(chunk_old); }
void cubes_refresh(int x, int y, int z, struct chunk dat) {
for (int i = 0; i < CHUNK_ALL; i++) {
if (chunk_old[i].exists != 0 && chunk_old[i].x == x &&
chunk_old[i].y == y && chunk_old[i].z == z) {
if (chunk_old[i].exists != 0 && abs(((int)chunk_old[i].x) - x) <= 1 &&
abs(((int)chunk_old[i].y) - y) <= 1 && abs(((int)chunk_old[i].z) - z) <= 1) {
chunk_old[i].exists = 0;
gen_save(dat);
return;
}
}
gen_save(dat);
}
int cubes_vert(struct v3f *cube, struct v3f *text, struct v3f *cubeO,