MapNode liquidnode = CONTENT_IGNORE;
if (bmgn) {
- Biome *biome = (Biome *)bmgn->calcBiomeAtPoint(cpabs);
+ Biome *biome = nullptr;
+ if (cpabs.X < node_min.X || cpabs.X > node_max.X ||
+ cpabs.Z < node_min.Z || cpabs.Z > node_max.Z)
+ // Point is outside heat and humidity noise maps so use point noise
+ // calculations.
+ biome = (Biome *)bmgn->calcBiomeAtPoint(cpabs);
+ else
+ // Point is inside heat and humidity noise maps so use them
+ biome = (Biome *)bmgn->getBiomeAtPoint(cpabs);
+
if (biome->c_cave_liquid != CONTENT_IGNORE)
liquidnode = biome->c_cave_liquid;
}
else
vm->m_data[i] = airnode;
} else {
- if (c == CONTENT_IGNORE)
- continue;
-
vm->m_data[i] = airnode;
vm->m_flags[i] |= VMANIP_FLAG_CAVE;
}
vm->m_data[i] = airnode;
}
} else {
- if (c == CONTENT_IGNORE || c == CONTENT_AIR)
+ if (c == CONTENT_AIR)
continue;
vm->m_data[i] = airnode;