From 84cbc3d00ea8d3ac4ae4950877e39a8c51c9acf8 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sat, 29 Sep 2018 17:50:02 -0700 Subject: [PATCH] Fix illegal use of floating point in pattern, https://github.com/iceiix/steven/issues/1 https://github.com/rust-lang/rust/issues/41620 --- src/model/liquid.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/model/liquid.rs b/src/model/liquid.rs index 6224d32..9e5c58c 100644 --- a/src/model/liquid.rs +++ b/src/model/liquid.rs @@ -58,10 +58,10 @@ pub fn render_liquid(textures: Arc>,lav if vert.y == 0.0 { vert.y = y as f32; } else { - let height = match (vert.x, vert.z) { - (0.0, 0.0) => ((16.0 / 8.0) * (tl as f32)) as i32, - (_, 0.0) => ((16.0 / 8.0) * (tr as f32)) as i32, - (0.0, _) => ((16.0 / 8.0) * (bl as f32)) as i32, + let height = match (vert.x as i64, vert.z as i64) { + (0, 0) => ((16.0 / 8.0) * (tl as f32)) as i32, + (_, 0) => ((16.0 / 8.0) * (tr as f32)) as i32, + (0, _) => ((16.0 / 8.0) * (bl as f32)) as i32, (_, _) => ((16.0 / 8.0) * (br as f32)) as i32, }; vert.y = (height as f32)/16.0 + (y as f32);