Skip to content

Commit

Permalink
Fix post-kerbin-mining-corporation#165: distortion toggle works again
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyOThan committed Oct 4, 2024
1 parent bbe71ea commit 1d92fe6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/Waterfall/Modules/ModuleWaterfallFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ private void GatherRenderers()
hasAdditiveShaders = false;
hasAlphaBlendedShaders = false;

foreach (var fx in activeFX)
for (int i = activeFX.Count; i-- > 0;)
{
var fx = activeFX[i];
foreach (var renderer in fx.effectRenderers)
{
Material mat = renderer.material;
Expand All @@ -116,6 +117,12 @@ private void GatherRenderers()
if (mat.HasProperty(ShaderPropertyID._Strength))
{
mat.renderQueue = Settings.DistortQueue;
if (!Settings.EnableDistortion)
{
fx.CleanupEffect();
activeFX.RemoveAt(i);
break;
}
}
else
{
Expand Down

0 comments on commit 1d92fe6

Please sign in to comment.