Merge pull request #1236 from JoePfeiffer/fix-1226
Check for active upper stage before dropping booster
This commit is contained in:
commit
21b099d08f
@ -425,12 +425,13 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
||||
}
|
||||
|
||||
case STAGE_SEPARATION: {
|
||||
// Record the event.
|
||||
currentStatus.getFlightData().addEvent(event);
|
||||
|
||||
RocketComponent boosterStage = event.getSource();
|
||||
final int stageNumber = boosterStage.getStageNumber();
|
||||
|
||||
if (currentStatus.getConfiguration().isStageActive(stageNumber-1)) {
|
||||
// Record the event.
|
||||
currentStatus.getFlightData().addEvent(event);
|
||||
|
||||
// Mark the status as having dropped the booster
|
||||
currentStatus.getConfiguration().clearStage( stageNumber);
|
||||
|
||||
@ -443,6 +444,9 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
||||
log.info(String.format("==>> @ %g; from Branch: %s ---- Branching: %s ---- \n",
|
||||
currentStatus.getSimulationTime(),
|
||||
currentStatus.getFlightData().getBranchName(), boosterStatus.getFlightData().getBranchName()));
|
||||
} else {
|
||||
log.debug("upper stage is not active; not performing separation");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user