Log a warning if you do the anglerfish thing

This commit is contained in:
xen-42 2024-10-03 00:14:41 -04:00
parent c9fa785ac6
commit 96a08d410e

View File

@ -1,5 +1,6 @@
using NewHorizons.Builder.General; using NewHorizons.Builder.General;
using NewHorizons.Components; using NewHorizons.Components;
using NewHorizons.Components.Orbital;
using NewHorizons.Components.Props; using NewHorizons.Components.Props;
using NewHorizons.External.Modules.Props; using NewHorizons.External.Modules.Props;
using NewHorizons.Handlers; using NewHorizons.Handlers;
@ -374,6 +375,12 @@ namespace NewHorizons.Builder.Props
// Fix anglerfish speed on orbiting planets // Fix anglerfish speed on orbiting planets
else if (component is AnglerfishController angler) else if (component is AnglerfishController angler)
{ {
if (planetGO?.GetComponent<NHAstroObject>() is NHAstroObject nhao && !nhao.invulnerableToSun)
{
// Has a fluid detector, will go gorp (#830)
NHLogger.LogWarning("Having an anglerfish on a planet that has a fluid detector can lead to things breaking!");
}
try try
{ {
angler._chaseSpeed += OWPhysics.CalculateOrbitVelocity(planetGO.GetAttachedOWRigidbody(), planetGO.GetComponent<AstroObject>().GetPrimaryBody().GetAttachedOWRigidbody()).magnitude; angler._chaseSpeed += OWPhysics.CalculateOrbitVelocity(planetGO.GetAttachedOWRigidbody(), planetGO.GetComponent<AstroObject>().GetPrimaryBody().GetAttachedOWRigidbody()).magnitude;