X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgenerator.cpp;h=f701230de014a4fee02e0ea372e810c4e694d149;hb=5756512831c0ebd625dd2a58233c7653ebe3c2ba;hp=60708e021a01c93751b1aa767963cc3add0c4d57;hpb=28fda9f7f55a9e806ade3f49f4e94f0242ec2c3c;p=blank.git diff --git a/src/generator.cpp b/src/generator.cpp index 60708e0..f701230 100644 --- a/src/generator.cpp +++ b/src/generator.cpp @@ -10,6 +10,7 @@ Generator::Generator(unsigned int seed) , typeNoise(seed + 1) , stretch(64.0f) , solid_threshold(0.8f) +, space(0) , solids() { } @@ -27,7 +28,9 @@ void Generator::operator ()(Chunk &chunk) const { float val = solidNoise(gen_pos); if (val > solid_threshold) { int type_val = int((typeNoise(gen_pos) + 1.0f) * solids.size()) % solids.size(); - chunk.BlockAt(block_pos) = Block(solids[type_val]); + chunk.SetBlock(block_pos, Block(solids[type_val])); + } else { + chunk.SetBlock(block_pos, Block(space)); } } }