From aca38d0cf48366806bd9ff54b3c58396fc22741e Mon Sep 17 00:00:00 2001 From: flo666 Date: Tue, 9 May 2023 00:57:58 +0200 Subject: [PATCH] review fixes --- server/src/events/inventory_manip.rs | 2 +- voxygen/anim/src/biped_small/alpha.rs | 2 +- voxygen/anim/src/biped_small/wield.rs | 2 +- world/src/site2/mod.rs | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index 17f07cf8b8..ed66d81b44 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -322,7 +322,7 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv // TODO: Abstract this code into a generalised way to do block updates? if matches!( block.get_sprite(), - Some(SpriteKind::Keyhole) | Some(SpriteKind::BoneKeyhole) + Some(SpriteKind::Keyhole | SpriteKind::BoneKeyhole) ) { let dirs = [ Vec3::unit_x(), diff --git a/voxygen/anim/src/biped_small/alpha.rs b/voxygen/anim/src/biped_small/alpha.rs index 1b9a00d9a3..fcc28b1f20 100644 --- a/voxygen/anim/src/biped_small/alpha.rs +++ b/voxygen/anim/src/biped_small/alpha.rs @@ -113,7 +113,7 @@ impl Animation for AlphaAnimation { next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel) * Quaternion::rotation_z(fast * 0.15 * speednormcancel); }, - Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Pick) => { + Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Pick) => { next.head.orientation = Quaternion::rotation_z(move1abs * 0.3 + move2abs * -0.6); next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); next.control_r.position = Vec3::new( diff --git a/voxygen/anim/src/biped_small/wield.rs b/voxygen/anim/src/biped_small/wield.rs index 8659e6fd91..33600489b7 100644 --- a/voxygen/anim/src/biped_small/wield.rs +++ b/voxygen/anim/src/biped_small/wield.rs @@ -167,7 +167,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_y(-0.2 * speednorm) * Quaternion::rotation_z(0.5); }, - Some(ToolKind::Axe) | Some(ToolKind::Hammer | ToolKind::Pick) => { + Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Pick) => { next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); next.control_r.position = Vec3::new(9.0 + s_a.grip.0 * 2.0, -1.0, -2.0 + speednorm * -3.0); diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 57c56e2e28..72e6049ccf 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -1423,8 +1423,10 @@ impl Site { } let mut last_block = None; - // TODO: Don't unwrap here - let col = canvas.col(wpos).unwrap().get_info(); + let col = canvas + .col(wpos) + .map(|col| col.get_info()) + .unwrap_or_default(); for z in aabb.min.z..aabb.max.z { let pos = Vec3::new(x, y, z);