Make SimulationOptions.copyFrom prefer matches based on exact match of

the configuration id.
This commit is contained in:
kruland2607 2013-03-27 22:12:09 -05:00
parent 4cc3485fa0
commit ea3aeedf1b

View File

@ -404,6 +404,10 @@ public class SimulationOptions implements ChangeSource, Cloneable {
} else {
if (src.rocket.hasMotors(src.motorID)) {
// First check for exact match:
if (this.rocket.isFlightConfigurationID(src.motorID)) {
this.motorID = src.motorID;
} else {
// Try to find a closely matching motor ID
MotorDescriptionSubstitutor formatter = Application.getInjector().getInstance(MotorDescriptionSubstitutor.class);
@ -419,6 +423,7 @@ public class SimulationOptions implements ChangeSource, Cloneable {
}
this.motorID = matchID;
}
} else {
this.motorID = null;
}