]> git.localhorst.tv Git - blank.git/blobdiff - src/world/chunk.cpp
function to get mtime
[blank.git] / src / world / chunk.cpp
index 452e7aa3b3cf23345c7cb1e7f085e3c5d16572c5..baad4466cde01790851b5f8877e2350d4e8a53b5 100644 (file)
@@ -668,7 +668,11 @@ void ChunkRenderer::LoadTextures(const AssetLoader &loader, const TextureIndex &
 
 void ChunkRenderer::Update(int dt) {
        for (int i = 0, updates = 0; updates < dt && i < index.TotalChunks(); ++i) {
-               if (index[i] && index[i]->ShouldUpdateModel()) {
+               if (!index[i]) continue;
+               if (!index[i]->Lighted() && index.HasAllSurrounding(index[i]->Position())) {
+                       index[i]->ScanLights();
+               }
+               if (index[i]->ShouldUpdateModel()) {
                        index[i]->Update(models[i]);
                        ++updates;
                }