Index out... Fix
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 18 KiB |
@@ -144,19 +144,24 @@ public class World : MonoBehaviour
|
||||
for (int x = playerChunk.x - Data.viewDistance; x < playerChunk.x + Data.viewDistance; x++)
|
||||
{
|
||||
for (int z = playerChunk.z - Data.viewDistance; z < playerChunk.z + Data.viewDistance; z++)
|
||||
{
|
||||
if(z >= 0 && x >= 0 && z < worldSize && x < worldSize)
|
||||
{
|
||||
if (chunks[x, z].gameObject == null)
|
||||
{
|
||||
chunks[x, z].Initialize();
|
||||
chunks[x, z].gameObject.transform.SetParent(gameObject.transform);
|
||||
}
|
||||
|
||||
if (!chunks[x, z].active)
|
||||
{
|
||||
chunksToUpdate1.Enqueue(new ChunkCoord(x, z));
|
||||
}
|
||||
|
||||
checkList.Add(chunks[x, z]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Chunk c in lastActiveChunks)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user