Fix incorrect array length for vector operator.
This commit is contained in:
@@ -985,7 +985,7 @@ namespace Cryville.Crtr {
|
|||||||
op.GetArraySuffix(out type, out _);
|
op.GetArraySuffix(out type, out _);
|
||||||
if (type != PdtInternalType.Number)
|
if (type != PdtInternalType.Number)
|
||||||
throw new InvalidOperationException("Not a vector of numbers");
|
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) {
|
fixed (float* ptr = values) {
|
||||||
op.CopyTo((byte*)ptr, 0, op.Length - sizeof(int));
|
op.CopyTo((byte*)ptr, 0, op.Length - sizeof(int));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user