mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 16:15:43 +00:00
ZoneCodeGenerator: Make setting a dynamic array size only possible if the targeted member is the last entry of its structure
This commit is contained in:
parent
57ef79692a
commit
ec8c00a4b9
@ -26,7 +26,6 @@ namespace ZoneCodeGenerator.Parsing.CommandFile.Tests
|
|||||||
|
|
||||||
public TestArraySize() : base(matchers)
|
public TestArraySize() : base(matchers)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ProcessMatch(ICommandParserState state)
|
protected override void ProcessMatch(ICommandParserState state)
|
||||||
@ -62,6 +61,13 @@ namespace ZoneCodeGenerator.Parsing.CommandFile.Tests
|
|||||||
var reference = referencedMember.Member.VariableType.References.OfType<ReferenceTypeArray>()
|
var reference = referencedMember.Member.VariableType.References.OfType<ReferenceTypeArray>()
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
if (!referencedMember.Parent.IsUnion &&
|
||||||
|
referencedMember.Parent.Type.Members.Last() != referencedMember.Member)
|
||||||
|
{
|
||||||
|
throw new TestFailedException(
|
||||||
|
"Cannot change the array size of a member that is not the last member of its structure.");
|
||||||
|
}
|
||||||
|
|
||||||
if (reference != null)
|
if (reference != null)
|
||||||
reference.DynamicSize = evaluation;
|
reference.DynamicSize = evaluation;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user