From 44c96f1ee0accfd7132fa271c3dc283bc31b5229 Mon Sep 17 00:00:00 2001 From: "yrsegal@gmail.com" Date: Fri, 30 Sep 2022 20:31:25 -0400 Subject: [PATCH] Close #240 This doesn't completely eliminate the issue but it does mitigate it significantly --- .../hexcasting/common/casting/operators/OpBlockAxisRaycast.kt | 2 ++ .../hexcasting/common/casting/operators/OpBlockRaycast.kt | 2 ++ .../hexcasting/common/casting/operators/OpEntityRaycast.kt | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockAxisRaycast.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockAxisRaycast.kt index 0070be12..6b7095be 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockAxisRaycast.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockAxisRaycast.kt @@ -14,6 +14,8 @@ object OpBlockAxisRaycast : ConstManaOperator { val origin: Vec3 = args.getChecked(0, argc) val look: Vec3 = args.getChecked(1, argc) + ctx.assertVecInRange(origin) + val blockHitResult = ctx.world.clip( ClipContext( origin, diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockRaycast.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockRaycast.kt index 0da0082b..70ff9005 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockRaycast.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockRaycast.kt @@ -14,6 +14,8 @@ object OpBlockRaycast : ConstManaOperator { val origin: Vec3 = args.getChecked(0, argc) val look: Vec3 = args.getChecked(1, argc) + ctx.assertVecInRange(origin) + val blockHitResult = ctx.world.clip( ClipContext( origin, diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityRaycast.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityRaycast.kt index 8dfff6c6..0e779e5c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityRaycast.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityRaycast.kt @@ -15,6 +15,8 @@ object OpEntityRaycast : ConstManaOperator { val look: Vec3 = args.getChecked(1, argc) val endp = Operator.raycastEnd(origin, look) + ctx.assertVecInRange(origin) + val entityHitResult = ProjectileUtil.getEntityHitResult( ctx.caster, origin,