diff --git a/Generated/Classes.cs b/Generated/Classes.cs index ce731da..e2eb507 100644 --- a/Generated/Classes.cs +++ b/Generated/Classes.cs @@ -1,5 +1,5 @@ // Auto-generated list of creatable Roblox classes. -// Updated as of 0.447.1.411123 +// Updated as of 0.448.0.411244 using System; @@ -2288,6 +2288,7 @@ namespace RobloxFiles public float FallenPartsDestroyHeight = -500; public bool FilteringEnabled; public float Gravity = 196.2f; + public InterpolationThrottlingMode InterpolationThrottling = InterpolationThrottlingMode.Default; public bool StreamingEnabled; public int StreamingMinRadius = 64; public StreamingPauseMode StreamingPauseMode = StreamingPauseMode.Default; diff --git a/Generated/Enums.cs b/Generated/Enums.cs index b64a36b..f1f7b0f 100644 --- a/Generated/Enums.cs +++ b/Generated/Enums.cs @@ -1,5 +1,5 @@ // Auto-generated list of Roblox enums. -// Updated as of 0.447.1.411123 +// Updated as of 0.448.0.411244 namespace RobloxFiles.Enums { @@ -336,6 +336,13 @@ namespace RobloxFiles.Enums Sin } + public enum InterpolationThrottlingMode + { + Default, + Disabled, + Enabled + } + public enum LeftRight { Left, diff --git a/RobloxFileFormat.dll b/RobloxFileFormat.dll index fd76518..a7ba9b6 100644 Binary files a/RobloxFileFormat.dll and b/RobloxFileFormat.dll differ diff --git a/Tree/Instance.cs b/Tree/Instance.cs index 2a1a836..5de87fc 100644 --- a/Tree/Instance.cs +++ b/Tree/Instance.cs @@ -32,14 +32,17 @@ namespace RobloxFiles /// The raw list of children for this Instance. internal HashSet Children = new HashSet(); - /// The raw value of the Instance's parent. - private Instance RawParent; + /// The raw unsafe value of the Instance's parent. + private Instance ParentUnsafe; /// The name of this Instance. public string Name; /// Indicates whether this Instance should be serialized. public bool Archivable = true; + + /// The source AssetId this instance was created in. + public long SourceAssetId = -1; /// The name of this Instance, if a Name property is defined. public override string ToString() => Name; @@ -174,25 +177,35 @@ namespace RobloxFiles /// public Instance Parent { - get - { - return RawParent; - } + get => ParentUnsafe; + set { if (ParentLocked) - throw new Exception("The Parent property of this instance is locked."); + { + string newParent = value?.Name ?? "NULL", + currParent = Parent?.Name ?? "NULL"; + + throw new InvalidOperationException($"The Parent property of {Name} is locked, current parent: {currParent}, new parent {newParent}"); + } if (IsAncestorOf(value)) - throw new Exception("Parent would result in circular reference."); + { + string pathA = GetFullName("."), + pathB = value.GetFullName("."); + + throw new InvalidOperationException($"Attempt to set parent of {pathA} to {pathB} would result in circular reference"); + } if (Parent == this) - throw new Exception("Attempt to set parent to self."); + throw new InvalidOperationException($"Attempt to set {Name} as its own parent"); - RawParent?.Children.Remove(this); - value?.Children.Add(this); - - RawParent = value; + lock (ParentUnsafe) + { + ParentUnsafe?.Children.Remove(this); + value?.Children.Add(this); + ParentUnsafe = value; + } } }