Sync sims modID after file import
This fixes loaded sims to still be marked as up-to-date after .ork importing
This commit is contained in:
parent
993cd3169a
commit
25f0984334
@ -339,7 +339,13 @@ public class Simulation implements ChangeSource, Cloneable {
|
||||
public static boolean isStatusUpToDate(Status status) {
|
||||
return status == Status.UPTODATE || status == Status.LOADED || status == Status.EXTERNAL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Syncs the modID with its flight configuration.
|
||||
*/
|
||||
public void syncModID() {
|
||||
this.simulatedConfigurationID = getActiveConfiguration().getModID();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -62,6 +63,7 @@ public class OpenRocketLoader extends AbstractRocketLoader {
|
||||
// Deduce suitable time skip
|
||||
double timeSkip = StorageOptions.SIMULATION_DATA_NONE;
|
||||
for (Simulation s : doc.getSimulations()) {
|
||||
s.syncModID(); // The config's modID can be out of sync with the simulation's after the whole loading process
|
||||
if (s.getStatus() == Simulation.Status.EXTERNAL ||
|
||||
s.getStatus() == Simulation.Status.NOT_SIMULATED)
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user