mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix ship not being added to volumes
This commit is contained in:
parent
53d3f70a22
commit
738c41701a
@ -115,6 +115,23 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
// For some reason none of this seems to apply to the Player.
|
// For some reason none of this seems to apply to the Player.
|
||||||
// If somebody ever makes a sound volume thats somehow always applying to the player tho then itd probably be this
|
// If somebody ever makes a sound volume thats somehow always applying to the player tho then itd probably be this
|
||||||
|
|
||||||
|
|
||||||
|
// Sometimes the ship isn't added to the volumes it's meant to now be in
|
||||||
|
// We'll just toggle all volumes on the planet on and off
|
||||||
|
var shipDetector = Locator.GetShipDetector().GetComponent<AlignmentForceDetector>();
|
||||||
|
var shipDetector2 = Locator.GetShipDetector().GetComponent<ShipFluidDetector>();
|
||||||
|
foreach (var volume in SpawnPointBuilder.ShipSpawn.GetAttachedOWRigidbody().GetComponentsInChildren<EffectVolume>())
|
||||||
|
{
|
||||||
|
if (volume.GetOWTriggerVolume().GetDistanceToBoundary(ship.transform.position) <= 0)
|
||||||
|
{
|
||||||
|
// Add ship to volume
|
||||||
|
// If it's already tracking it it will complain here but thats fine
|
||||||
|
shipDetector.AddVolume(volume);
|
||||||
|
shipDetector2.AddVolume(volume);
|
||||||
|
volume.GetOWTriggerVolume().AddObjectToVolume(shipDetector.gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Main.Instance.CurrentStarSystem != "SolarSystem" && !Main.Instance.IsWarpingFromShip)
|
else if (Main.Instance.CurrentStarSystem != "SolarSystem" && !Main.Instance.IsWarpingFromShip)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user