File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ public boolean isVecInRangeEnvironment(Vec3 vec) {
139139 if (sentinel != null
140140 && sentinel .extendsRange ()
141141 && caster .level ().dimension () == sentinel .dimension ()
142- && vec .distanceToSqr (sentinel .position ()) <= SENTINEL_RADIUS * SENTINEL_RADIUS
142+ && vec .distanceToSqr (sentinel .position ()) <= SENTINEL_RADIUS * SENTINEL_RADIUS + 0.00000000001
143143 ) {
144144 return true ;
145145 }
Original file line number Diff line number Diff line change @@ -178,12 +178,13 @@ public boolean isVecInRangeEnvironment(Vec3 vec) {
178178 if (sentinel != null
179179 && sentinel .extendsRange ()
180180 && this .caster .level ().dimension () == sentinel .dimension ()
181- && vec .distanceToSqr (sentinel .position ()) <= SENTINEL_RADIUS * SENTINEL_RADIUS
181+ // adding 0.00000000001 to avoid machine precision errors at specific angles
182+ && vec .distanceToSqr (sentinel .position ()) <= SENTINEL_RADIUS * SENTINEL_RADIUS + 0.00000000001
182183 ) {
183184 return true ;
184185 }
185186
186- return vec .distanceToSqr (this .caster .position ()) <= AMBIT_RADIUS * AMBIT_RADIUS ;
187+ return vec .distanceToSqr (this .caster .position ()) <= AMBIT_RADIUS * AMBIT_RADIUS + 0.00000000001 ;
187188 }
188189
189190 @ Override
You can’t perform that action at this time.
0 commit comments