Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static bool PartGeometryUtil_GetPartRendererBounds_Prefix(Part p, out Bounds[] _
//
// This matches the same rule as done in https://github.com/KSPModdingLibs/KSPCommunityFixes/issues/150
// which isn't really perfect, but is probably good enough for our purposes.
bool ignoreTransparentFX = !p.frozen;
bool ignoreTransparentFX = !p.frozen && !AllParentsTransparent(p.transform);

try
{
Expand All @@ -69,6 +69,12 @@ static bool PartGeometryUtil_GetPartRendererBounds_Prefix(Part p, out Bounds[] _

return false;
}
static bool AllParentsTransparent(Transform t)
{
if (t.gameObject.layer != LayerMask.NameToLayer("TransparentFX")) return false;
if (t.parent == null) return true;
return AllParentsTransparent(t.parent);
}

static readonly List<Renderer> rendererBuffer = [];

Expand Down