Grass spread: check chunk & light validity correctly
This commit is contained in:
parent
281beba50e
commit
10bd15a11e
|
@ -52,7 +52,7 @@ private:
|
||||||
const Vector3i a_RelPos
|
const Vector3i a_RelPos
|
||||||
) const override
|
) 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());
|
a_Chunk.GetWorld()->QueueLightChunk(a_Chunk.GetPosX(), a_Chunk.GetPosZ());
|
||||||
return;
|
return;
|
||||||
|
@ -133,7 +133,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(a_RelPos);
|
auto Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(a_RelPos);
|
||||||
if (Chunk == nullptr)
|
if ((Chunk == nullptr) || !Chunk->IsValid())
|
||||||
{
|
{
|
||||||
// Unloaded chunk
|
// Unloaded chunk
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user