X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2Fchunk.cpp;h=baad4466cde01790851b5f8877e2350d4e8a53b5;hb=1daba5b2fa044c1822d104fb65eeb88b6aeb5499;hp=452e7aa3b3cf23345c7cb1e7f085e3c5d16572c5;hpb=c3397eb26a844ded6ddbf92c95cbb87cd3baf65d;p=blank.git diff --git a/src/world/chunk.cpp b/src/world/chunk.cpp index 452e7aa..baad446 100644 --- a/src/world/chunk.cpp +++ b/src/world/chunk.cpp @@ -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; }