0.454.0.413308

This commit is contained in:
CloneTrooper1019
2020-10-30 15:07:11 -05:00
parent c4a3145007
commit 988469ac04
13 changed files with 1063 additions and 222 deletions

View File

@ -56,6 +56,14 @@ namespace RobloxFiles.BinaryFormat.Chunks
int id = ids[i];
Instance instance = file.Instances[id];
if (instance == null)
{
if (RobloxFile.LogErrors)
Console.Error.WriteLine($"PROP: No instance @{id} for property {ClassName}.{Name}");
continue;
}
Property prop = new Property(instance, this);
props[i] = prop;
@ -71,6 +79,10 @@ namespace RobloxFiles.BinaryFormat.Chunks
for (int i = 0; i < instCount; i++)
{
var prop = props[i];
if (prop == null)
continue;
prop.Value = read(i);
}
});
@ -593,9 +605,9 @@ namespace RobloxFiles.BinaryFormat.Chunks
foreach (int instId in inst.InstanceIds)
{
Instance instance = file.Instances[instId];
Property prop = instance.Properties[Name];
var instProps = instance.Properties;
if (prop == null)
if (!instProps.TryGetValue(Name, out Property prop))
throw new Exception($"Property {Name} must be defined in {instance.GetFullName()}!");
else if (prop.Type != Type)
throw new Exception($"Property {Name} is not using the correct type in {instance.GetFullName()}!");