Problematic detection fix (#10372)

This commit is contained in:
Elixias 2024-12-14 11:29:52 -07:00 committed by GitHub
parent 3ff6f834a5
commit 30328e61a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -413,7 +413,7 @@ public class Planet extends UnlockableContent{
Vec3 vec = intersect(ray, radius); Vec3 vec = intersect(ray, radius);
if(vec == null) return null; if(vec == null) return null;
vec.sub(position).rotate(Vec3.Y, getRotation()); vec.sub(position).rotate(Vec3.Y, getRotation());
return sectors.min(t -> t.tile.v.dst2(vec)); return sectors.min(t -> Tmp.v31.set(t.tile.v).setLength(radius).dst2(vec));
} }
/** @return the sector that is hit by this ray, or null if nothing intersects it. */ /** @return the sector that is hit by this ray, or null if nothing intersects it. */