Skip to content

Commit

Permalink
Move GenerateTerrain to updatelogic.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin452 committed Mar 25, 2024
1 parent 47ba964 commit 63973b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/world/chunks/chunkmain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function NewChunk(x, z)
for i = 1, ChunkSize do
chunk.heightMap[i] = {}
end
GenerateTerrain(chunk, x, z, GlobalWorldType)
local gx, gz = (chunk.x - 1) * ChunkSize + rand(0, 15), (chunk.z - 1) * ChunkSize + rand(0, 15)
if choose({ true, false }) then
for _, config in ipairs(caveConfigs) do
Expand Down
1 change: 1 addition & 0 deletions src/world/updatelogic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ local function GetOrCreateChunk(chunkX, chunkZ)
else
chunk = NewChunk(chunkX, chunkZ)
end
GenerateTerrain(chunk, chunkX, chunkZ, GlobalWorldType)
ChunkSet[chunk] = true
ChunkHashTable[ChunkHash(chunkX)] = ChunkHashTable[ChunkHash(chunkX)] or {}
ChunkHashTable[ChunkHash(chunkX)][ChunkHash(chunkZ)] = chunk
Expand Down

0 comments on commit 63973b0

Please sign in to comment.