1
0
Fork 0

Grass spread: check chunk & light validity correctly

This commit is contained in:
Tiger Wang 2020-09-22 21:17:52 +01:00
parent 281beba50e
commit 10bd15a11e
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ private:
const Vector3i a_RelPos
) const override
{
if (!a_Chunk.GetWorld()->IsChunkLighted(a_Chunk.GetPosX(), a_Chunk.GetPosZ()))
if (!a_Chunk.IsLightValid())
{
a_Chunk.GetWorld()->QueueLightChunk(a_Chunk.GetPosX(), a_Chunk.GetPosZ());
return;
@ -133,7 +133,7 @@ private:
}
auto Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(a_RelPos);
if (Chunk == nullptr)
if ((Chunk == nullptr) || !Chunk->IsValid())
{
// Unloaded chunk
return;