mirror of
https://github.com/lune-org/lune.git
synced 2024-12-13 13:30:38 +00:00
Prevent setting Parent prop of DataModel instances
This commit is contained in:
parent
178f7b41ab
commit
a21861918b
1 changed files with 5 additions and 0 deletions
|
@ -732,6 +732,11 @@ impl LuaUserData for Instance {
|
||||||
"Failed to set property '{}' - root instance can not be reparented",
|
"Failed to set property '{}' - root instance can not be reparented",
|
||||||
prop_name
|
prop_name
|
||||||
)));
|
)));
|
||||||
|
} else if this.get_class_name() == "DataModel" {
|
||||||
|
return Err(LuaError::RuntimeError(format!(
|
||||||
|
"Failed to set property '{}' - DataModel can not be reparented",
|
||||||
|
prop_name
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
type Parent = Option<Instance>;
|
type Parent = Option<Instance>;
|
||||||
match Parent::from_lua(prop_value, lua)? {
|
match Parent::from_lua(prop_value, lua)? {
|
||||||
|
|
Loading…
Reference in a new issue