lol idk #1

Open
Quaternions wants to merge 826 commits from StrafesNET/strafe-project:master into master
Showing only changes of commit a9a4ed2c46 - Show all commits

View File

@ -251,10 +251,18 @@ impl Instance{
let dereferent:Dereferent=mlua::AnyUserDataExt::get(&this,"Referent")?;
dom_mut(lua,|dom|{
let instance=dereferent.get(dom)?;
match instance.properties.get(index_str){
//Find existing property
match instance.properties.get(index_str)
//Find default value
.or_else(||{
let db=rbx_reflection_database::get();
db.classes.get(instance.class.as_str()).and_then(|cd|
db.find_default_property(cd,index_str)
)
})
{
Some(&rbx_types::Variant::CFrame(cf))=>return Ok(Into::<super::cframe::CFrame>::into(cf).into_lua(lua)),
Some(&rbx_types::Variant::Vector3(v))=>return Ok(Into::<super::vector3::Vector3>::into(v).into_lua(lua)),
//None=>get_default_value
_=>(),
}
//find a child with a matching name