Add error handling for setting text.frames.

This commit is contained in:
2023-02-17 14:41:12 +08:00
parent 0d4cc5e208
commit 7015426300

View File

@@ -25,6 +25,8 @@ namespace Cryville.Crtr.Components {
var values = GetOperand(1);
int arrtype; int len;
values.GetArraySuffix(out arrtype, out len);
if (arrtype != PdtInternalType.String) throw new InvalidCastException("Not an array of strings");
if (len != keys.Length) throw new ArgumentException("Length of key not equal to frame count");
var result = new Dictionary<char, SpriteInfo>(len);
int o = 0;
for (int i = 0; i < len; i++) {