forked from StrafesNET/strafe-project
cframe: fixup FromLua
This commit is contained in:
parent
aa0bee9f69
commit
930ac1c331
@ -44,8 +44,8 @@ impl mlua::UserData for CFrame{
|
|||||||
impl<'lua> mlua::FromLua<'lua> for CFrame{
|
impl<'lua> mlua::FromLua<'lua> for CFrame{
|
||||||
fn from_lua(value:mlua::prelude::LuaValue<'lua>,_lua:&'lua mlua::prelude::Lua)->mlua::prelude::LuaResult<Self>{
|
fn from_lua(value:mlua::prelude::LuaValue<'lua>,_lua:&'lua mlua::prelude::Lua)->mlua::prelude::LuaResult<Self>{
|
||||||
match value{
|
match value{
|
||||||
mlua::Value::UserData(ud) => Ok(*ud.borrow::<Self>()?),
|
mlua::Value::UserData(ud)=>ud.take()?,
|
||||||
_ => unreachable!(),
|
other=>Err(mlua::Error::runtime(format!("Expected CFrame got {:?}",other))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user