From dff521bae7b2260ca278e40d58ac2006d7782768 Mon Sep 17 00:00:00 2001 From: "Mateo \"Kuruk\" Miccino" Date: Mon, 28 Oct 2024 08:55:44 -0300 Subject: [PATCH 1/3] fix: don't try to parse textures with empty data --- lib/src/content/texture.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/content/texture.rs b/lib/src/content/texture.rs index 7c1b58ee3..b5503a701 100644 --- a/lib/src/content/texture.rs +++ b/lib/src/content/texture.rs @@ -37,6 +37,10 @@ pub async fn load_image_texture( .await .map_err(anyhow::Error::msg)?; + if bytes_vec.len() == 0 { + return Err(anyhow::Error::msg("Empty texture data")); + } + let _thread_safe_check = GodotSingleThreadSafety::acquire_owned(&ctx) .await .ok_or(anyhow::Error::msg("Failed trying to get thread-safe check"))?; From ec1814f46e1fe1fb521b779cce3e612c9089b7ad Mon Sep 17 00:00:00 2001 From: "Mateo \"Kuruk\" Miccino" Date: Mon, 28 Oct 2024 08:56:01 -0300 Subject: [PATCH 2/3] fix: default rotation when the rotation is infinite --- lib/src/scene_runner/components/transform_and_parent.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/scene_runner/components/transform_and_parent.rs b/lib/src/scene_runner/components/transform_and_parent.rs index 4ada3eba8..126543da5 100644 --- a/lib/src/scene_runner/components/transform_and_parent.rs +++ b/lib/src/scene_runner/components/transform_and_parent.rs @@ -73,6 +73,10 @@ pub fn update_transform_and_parent( } } + if !transform.rotation.is_finite() { + transform.rotation = godot::prelude::Quaternion::default(); + } + node_3d.set_transform(transform.to_godot_transform_3d_without_scaled()); if transform.scale.x.is_zero_approx() { transform.scale.x = 0.00001; From 0ab667222bb1fe74995a88519511e14d4a16d145 Mon Sep 17 00:00:00 2001 From: "Mateo \"Kuruk\" Miccino" Date: Mon, 28 Oct 2024 09:19:31 -0300 Subject: [PATCH 3/3] clippy fix --- lib/src/content/texture.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/content/texture.rs b/lib/src/content/texture.rs index b5503a701..38040aaa6 100644 --- a/lib/src/content/texture.rs +++ b/lib/src/content/texture.rs @@ -37,7 +37,7 @@ pub async fn load_image_texture( .await .map_err(anyhow::Error::msg)?; - if bytes_vec.len() == 0 { + if bytes_vec.is_empty() { return Err(anyhow::Error::msg("Empty texture data")); }