diff --git a/src/rbx.rs b/src/rbx.rs index 8c41b20..f7626c7 100644 --- a/src/rbx.rs +++ b/src/rbx.rs @@ -19,7 +19,7 @@ fn class_is_a(class: &str, superclass: &str) -> bool { return class_is_a(&class_super, superclass) } } - return false + false } fn recursive_collect_superclass(objects: &mut std::vec::Vec,dom: &rbx_dom_weak::WeakDom, instance: &rbx_dom_weak::Instance, superclass: &str){ let mut stack=vec![instance]; @@ -465,20 +465,18 @@ pub fn convert)->model::RenderConfigId>(dom:&rbx_dom_weak:: let model_id=model::ModelId::new(models1.len() as u32); //TODO: also detect "CylinderMesh" etc here - let shape=match &object.class[..]{ - "Part"=>{ - if let Some(rbx_dom_weak::types::Variant::Enum(shape))=object.properties.get("Shape"){ - match shape.to_u32(){ - 0=>primitives::Primitives::Sphere, - 1=>primitives::Primitives::Cube, - 2=>primitives::Primitives::Cylinder, - 3=>primitives::Primitives::Wedge, - 4=>primitives::Primitives::CornerWedge, - _=>panic!("Funky roblox PartType={};",shape.to_u32()), - } - }else{ - panic!("Part has no Shape!"); + let shape=match object.class.as_str(){ + "Part"=>if let Some(rbx_dom_weak::types::Variant::Enum(shape))=object.properties.get("Shape"){ + match shape.to_u32(){ + 0=>primitives::Primitives::Sphere, + 1=>primitives::Primitives::Cube, + 2=>primitives::Primitives::Cylinder, + 3=>primitives::Primitives::Wedge, + 4=>primitives::Primitives::CornerWedge, + other=>panic!("Funky roblox PartType={};",other), } + }else{ + panic!("Part has no Shape!"); }, "TrussPart"=>primitives::Primitives::Cube, "WedgePart"=>primitives::Primitives::Wedge,