Correctly identify when time is past end of thrustcurve so thrust is 0 in getAverageThrust
This has been lurking -- we're not actually supposed to be calling getAverageThrustThrust when we're past the end of the thrustcurve (there's a test for whether the motor is active before calling it), but another bug in the parallel staging code exposed it.
This commit is contained in:
parent
939a07e9e0
commit
d2f364f086
@ -338,11 +338,11 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
|
||||
|
||||
int timeIndex = 0;
|
||||
|
||||
while( timeIndex < time.length-2 && startTime > time[timeIndex+1] ) {
|
||||
while( timeIndex < time.length-1 && startTime > time[timeIndex+1] ) {
|
||||
timeIndex++;
|
||||
}
|
||||
|
||||
if ( timeIndex == time.length ) {
|
||||
if ( timeIndex == time.length-1 ) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user