Fix anglerfish speed

This commit is contained in:
Nick J. Connors 2022-01-13 20:16:12 -05:00
parent 9905c2d10d
commit 784d654d3c
2 changed files with 15 additions and 4 deletions

View File

@ -83,6 +83,17 @@ namespace NewHorizons.Builder.Props
foreach(var component in prop.GetComponents<SectoredMonoBehaviour>()) foreach(var component in prop.GetComponents<SectoredMonoBehaviour>())
{ {
component.SetSector(sector); component.SetSector(sector);
if(component is AnglerfishController)
{
try
{
(component as AnglerfishController)._chaseSpeed += OWPhysics.CalculateOrbitVelocity(go.GetAttachedOWRigidbody(), go.GetComponent<AstroObject>().GetPrimaryBody().GetAttachedOWRigidbody()).magnitude;
}
catch(Exception e)
{
Logger.LogError($"Couldn't update AnglerFish chase speed: {e.Message}");
}
}
} }
foreach (var component in prop.GetComponentsInChildren<SectoredMonoBehaviour>()) foreach (var component in prop.GetComponentsInChildren<SectoredMonoBehaviour>())
{ {
@ -99,8 +110,7 @@ namespace NewHorizons.Builder.Props
if(enabledField != null && enabledField.FieldType == typeof(bool)) enabledField.SetValue(component, true); if(enabledField != null && enabledField.FieldType == typeof(bool)) enabledField.SetValue(component, true);
} }
//prop.transform.parent = go.transform; prop.transform.position = position == null ? go.transform.position : go.transform.TransformPoint((Vector3)position);
prop.transform.localPosition = position == null ? Vector3.zero : (Vector3)position;
Quaternion rot = rotation == null ? Quaternion.identity : Quaternion.Euler((Vector3)rotation); Quaternion rot = rotation == null ? Quaternion.identity : Quaternion.Euler((Vector3)rotation);
prop.transform.localRotation = rot; prop.transform.localRotation = rot;

View File

@ -3,7 +3,8 @@
"author": "xen", "author": "xen",
"name": "New Horizons", "name": "New Horizons",
"uniqueName": "xen.NewHorizons", "uniqueName": "xen.NewHorizons",
"version": "0.7.0", "version": "0.7.1",
"owmlVersion": "2.1.0", "owmlVersion": "2.1.0",
"dependencies": [ "PacificEngine.OW_CommonResources" ] "dependencies": [ "PacificEngine.OW_CommonResources" ],
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "Vesper.OuterWildsMMO", "Vesper.AutoResume" ]
} }