Move ShockEffect backwards compat to the right place

This commit is contained in:
Nick 2022-09-30 23:18:25 -04:00
parent fb2de48d8f
commit 9bc68d74e3
2 changed files with 7 additions and 1 deletions

View File

@ -420,6 +420,12 @@ namespace NewHorizons.External.Configs
if (ring.curve != null) ring.scaleCurve = ring.curve; if (ring.curve != null) ring.scaleCurve = ring.curve;
} }
} }
// So that old mods still have shock effects
if (ShockEffect == null && Star == null && name != "Sun" && name != "EyeOfTheUniverse" && FocalPoint == null)
{
ShockEffect = new ShockEffectModule() { hasSupernovaShockEffect = true };
}
} }
} }
} }

View File

@ -647,7 +647,7 @@ namespace NewHorizons.Handlers
CloakBuilder.Make(go, sector, rb, body.Config.Cloak, !body.Config.ReferenceFrame.hideInMap, body.Mod); CloakBuilder.Make(go, sector, rb, body.Config.Cloak, !body.Config.ReferenceFrame.hideInMap, body.Mod);
} }
if ((body.Config.ShockEffect == null && body.Config.Star == null && body.Config.name != "Sun" && body.Config.FocalPoint == null) || body.Config.ShockEffect?.hasSupernovaShockEffect == true) if (body.Config.ShockEffect?.hasSupernovaShockEffect == true)
{ {
SupernovaEffectBuilder.Make(go, sector, body.Config, body.Mod, procGen, ambientLight, fog, atmosphere, null, fog?._fogImpostor); SupernovaEffectBuilder.Make(go, sector, body.Config, body.Mod, procGen, ambientLight, fog, atmosphere, null, fog?._fogImpostor);
} }