fix: Ensure consistent terrain generation for all chunks at y=0
This commit is contained in:
parent
d34a695bb8
commit
c7735b8578
@ -62,12 +62,9 @@ function getOrCreateChunk(chunkX, chunkY) {
|
||||
|
||||
// Floor has been removed as it's no longer needed
|
||||
|
||||
// Get the current player chunk position
|
||||
const playerChunkX = Math.floor(worldOffsetX / CHUNK_SIZE);
|
||||
|
||||
// Special generation for chunks within 3 chunks of the player's position
|
||||
if (chunkY === 0 && Math.abs(chunkX - playerChunkX) <= 3) {
|
||||
generateSpecialChunk(chunkData, chunkX, playerChunkX);
|
||||
// Special generation for all chunks at y=0
|
||||
if (chunkY === 0) {
|
||||
generateSpecialChunk(chunkData, chunkX, chunkX);
|
||||
}
|
||||
|
||||
chunks.set(key, chunkData);
|
||||
|
Loading…
x
Reference in New Issue
Block a user