]> git.localhorst.tv Git - blank.git/commitdiff
invalidate meshes if surrounding chunks on insert
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 15 Oct 2015 13:41:31 +0000 (15:41 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 15 Oct 2015 13:41:31 +0000 (15:41 +0200)
this should fix the dark seams on chunk borders

src/world/chunk.cpp

index 800012e601cfa1cdc966b70f09ebd5876982e002..f819ef9be8ecacdeb90219862dc399f554d78a58 100644 (file)
@@ -636,9 +636,13 @@ bool ChunkLoader::LoadOne() {
                        for (iter.x = begin.x; iter.x < end.x; ++iter.x) {
                                if (index->IsBorder(iter)) continue;
                                Chunk *light_chunk = index->Get(iter);
-                               if (!light_chunk || light_chunk->Lighted()) continue;
+                               if (!light_chunk) continue;
                                if (index->HasAllSurrounding(iter)) {
-                                       light_chunk->ScanLights();
+                                       if (!light_chunk->Lighted()) {
+                                               light_chunk->ScanLights();
+                                       } else {
+                                               light_chunk->InvalidateMesh();
+                                       }
                                }
                        }
                }