Replace TrustedAsOfLength with safe As and Set.
This commit is contained in:
@@ -80,11 +80,10 @@ namespace Cryville.Crtr.Components {
|
||||
var o = GetOperand(0);
|
||||
if (o.Type != PdtInternalType.Vector) throw new ArgumentException("Not a vector");
|
||||
_self._shapeLength = (o.Length - sizeof(int)) / sizeof(Vector2);
|
||||
var ptr = (Vector2*)o.TrustedAsOfLength(sizeof(Vector2));
|
||||
if (_self._shape != null) _shapePool.Return(_self._shape);
|
||||
_self._shape = _shapePool.Rent(_self._shapeLength);
|
||||
for (int i = 0; i < _self._shapeLength; i++) {
|
||||
_self._shape[i] = ptr[i];
|
||||
_self._shape[i] = o.As<Vector2>(i * sizeof(Vector2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user