Fix overflow issue with basement.

This commit is contained in:
Joshua Yanovski
2020-01-11 20:57:40 +01:00
parent b5b017b4c6
commit 0e88be716d

View File

@ -262,10 +262,10 @@ impl<'a> BlockGen<'a> {
let block = if (wposf.z as f32) < height - grass_depth { let block = if (wposf.z as f32) < height - grass_depth {
let col = Lerp::lerp( let col = Lerp::lerp(
// saturate_srgb(sub_surface_color, 0.45).map(|e| (e * 255.0) as u8), // saturate_srgb(sub_surface_color, 0.45).map(|e| (e * 255.0) as u8),
sub_surface_color.map(|e| (e * 255.0) as u8), sub_surface_color,
stone_col, stone_col.map(|e| e as f32 / 255.0),
(height - grass_depth - wposf.z as f32) * 0.15, (height - grass_depth - wposf.z as f32) * 0.15,
); ).map(|e| (e * 255.0) as u8);
// Underground // Underground
if (wposf.z as f32) > alt - 32.0 * chaos { if (wposf.z as f32) > alt - 32.0 * chaos {