Fix incorrect array length for vector operator.

This commit is contained in:
2023-03-11 21:39:26 +08:00
parent 613ca467d0
commit 22190a29c1

View File

@@ -985,7 +985,7 @@ namespace Cryville.Crtr {
op.GetArraySuffix(out type, out _);
if (type != PdtInternalType.Number)
throw new InvalidOperationException("Not a vector of numbers");
values = new float[op.Length - sizeof(int)];
values = new float[(op.Length - sizeof(int)) / sizeof(float)];
fixed (float* ptr = values) {
op.CopyTo((byte*)ptr, 0, op.Length - sizeof(int));
}