Modify logic for "and" and "or" operator and in_area function. Add null marshaling for input proxy.

This commit is contained in:
2022-11-06 14:52:05 +08:00
parent 71a33c0b43
commit 65d86ed72d
2 changed files with 8 additions and 3 deletions

View File

@@ -117,10 +117,15 @@ namespace Cryville.Crtr {
readonly byte[] _vecbuf = new byte[3 * sizeof(float) + sizeof(int)];
unsafe void OnInput(InputIdentifier id, InputVector vec, string target) {
_etor.ContextCascadeInsert();
if (vec.IsNull) {
_etor.ContextCascadeUpdate(_var_value, new PropSrc.Arbitrary(PdtInternalType.Null, new byte[0]));
}
else {
fixed (byte* ptr = _vecbuf) {
*(Vector3*)ptr = vec.Vector;
}
_etor.ContextCascadeUpdate(_var_value, new PropSrc.Arbitrary(PdtInternalType.Vector, _vecbuf));
}
OnInput(id, target);
_etor.ContextCascadeDiscard();
}