From 328be44ed0245fa79c94f0c5fc640b70b4d55ff3 Mon Sep 17 00:00:00 2001 From: onezplpl Date: Thu, 18 Jul 2024 14:48:06 -0400 Subject: [PATCH] fix some block render glitches --- cubes.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cubes.c b/cubes.c index 2e31160..24d5119 100644 --- a/cubes.c +++ b/cubes.c @@ -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,