fix features generating when they shouldn't

This commit is contained in:
p2r3
2025-09-09 21:19:50 +03:00
parent 5c571df947
commit 55da6c7d4c

View File

@@ -172,9 +172,7 @@ uint8_t getHeightAt (int x, int z) {
uint8_t getTerrainAtFromCache (int x, int y, int z, int rx, int rz, ChunkAnchor anchor, ChunkFeature feature, uint8_t height) { uint8_t getTerrainAtFromCache (int x, int y, int z, int rx, int rz, ChunkAnchor anchor, ChunkFeature feature, uint8_t height) {
if (y < 64 || y < height) goto skip_feature; if (y >= 64 && y >= height && feature.y != 255) switch (anchor.biome) {
switch (anchor.biome) {
case W_plains: { // Generate trees in the plains biome case W_plains: { // Generate trees in the plains biome
// Don't generate trees underwater // Don't generate trees underwater
@@ -250,7 +248,6 @@ uint8_t getTerrainAtFromCache (int x, int y, int z, int rx, int rz, ChunkAnchor
default: break; default: break;
} }
skip_feature:
// Handle surface-level terrain (the very topmost blocks) // Handle surface-level terrain (the very topmost blocks)
if (height >= 63) { if (height >= 63) {
if (y == height) { if (y == height) {