From e2c74b8dfe272e3b87282bd8d9d9492f4feaff1a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 20 Sep 2024 17:54:43 -0700 Subject: [PATCH] use find_default_property --- src/runner/instance.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runner/instance.rs b/src/runner/instance.rs index b0719be..551c6ff 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -88,8 +88,9 @@ impl mlua::UserData for Instance{ dom(lua,|dom|{ let instance=this.get_mut(dom)?; let index_str=index.to_str()?; - let class=rbx_reflection_database::get().classes.get(instance.class.as_str()).ok_or(mlua::Error::runtime("Class missing"))?; - let property=class.default_properties.get(index_str).ok_or(mlua::Error::runtime(format!("Property '{index_str}' missing on class '{}'",class.name)))?; + let db=rbx_reflection_database::get(); + let class=db.classes.get(instance.class.as_str()).ok_or(mlua::Error::runtime("Class missing"))?; + let property=db.find_default_property(class,index_str).ok_or(mlua::Error::runtime(format!("Property '{index_str}' missing on class '{}'",class.name)))?; match property{ rbx_types::Variant::Vector3(_)=>{ let typed_value:Vector3=value.as_userdata().ok_or(mlua::Error::runtime("Expected Userdata"))?.take()?;