Skip to content

Commit

Permalink
[TerrainGenerator] Small fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Feb 11, 2020
1 parent 6f227b7 commit c1ccb2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/source/world/TerrainGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ void TerrainGenerator::basicGeneration(ServerChunk &chunk) const {
void TerrainGenerator::testCraftGeneration(ServerChunk &chunk) const {
srand(chunk.x() + chunk.y() + chunk.z() + 1337);
Chunk *topChunk = chunk.getSurroundingChunk(Chunk::Top);

for(int z = 0 ; z < CHUNK_DEPTH ; z++) {
for(int x = 0 ; x < CHUNK_WIDTH ; x++) {
// Land height
Expand All @@ -124,7 +125,7 @@ void TerrainGenerator::testCraftGeneration(ServerChunk &chunk) const {
// Otherwise we are in the air, so try to make a tree
else if(chunk.getBlock(x, y - 1, z) == m_grassBlockID && (rand() % 64) == 0 && n < 4) {
// Trunk
h = (rand() & 0x3) + 3;
int h = (rand() & 3) + 3;
for(int i = 0 ; i < h ; i++) {
chunk.setBlockRaw(x, y + i, z, m_logBlockID);
}
Expand Down

0 comments on commit c1ccb2f

Please sign in to comment.