John is a hater

This commit is contained in:
Nick 2022-06-19 18:06:17 -04:00
parent d2d81c2672
commit 0120b2d646

View File

@ -15,14 +15,13 @@ namespace NewHorizons.Components
public List<State> states = new List<State>();
public State groundState;
private int _currentIndex;
private NHAstroObject _astroObject;
private ConstantForceDetector _detector;
private AlignWithTargetBody _alignment;
private OWRigidbody _rb;
private OrbitLine _orbitLine;
public int CurrentIndex { get { return _currentIndex; } }
public int CurrentIndex { get; private set; }
public override void Awake()
{
@ -62,19 +61,19 @@ namespace NewHorizons.Components
var canChange = false;
var oldState = states[_currentIndex];
var oldState = states[CurrentIndex];
// This will all get set in the for loop
State newState = oldState;
int newIndex = _currentIndex;
int newIndex = CurrentIndex;
AstroObject primaryBody = null;
OrbitalParameters orbitalParams = null;
// The QM tries to switch 10 times so we'll do that too
for (int i = 0; i < 10; i++)
{
newIndex = _currentIndex;
while (newIndex == _currentIndex)
newIndex = CurrentIndex;
while (newIndex == CurrentIndex)
{
newIndex = Random.Range(0, states.Count - 1);
}
@ -110,7 +109,7 @@ namespace NewHorizons.Components
if (newState.sector != null && newState.sector != oldState.sector) SetNewSector(oldState, newState);
if (newState.orbit != null && newState.orbit != oldState.orbit) SetNewOrbit(primaryBody, orbitalParams);
_currentIndex = newIndex;
CurrentIndex = newIndex;
GlobalMessenger<OWRigidbody>.FireEvent("QuantumMoonChangeState", _rb);
}
@ -167,9 +166,9 @@ namespace NewHorizons.Components
public override bool IsPlayerEntangled()
{
if (_currentIndex >= states.Count) return true;
if (CurrentIndex >= states.Count) return true;
return states[_currentIndex].sector.ContainsAnyOccupants(DynamicOccupant.Player);
return states[CurrentIndex].sector.ContainsAnyOccupants(DynamicOccupant.Player);
}
public class State