mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-02-05 09:54:59 +01:00
Optimize navigation refresh
This commit is contained in:
parent
67ebc8a2c6
commit
57fbe3cb48
2 changed files with 4 additions and 6 deletions
|
@ -443,7 +443,7 @@ public class Navigation {
|
||||||
TrackGraph graph = train.graph;
|
TrackGraph graph = train.graph;
|
||||||
if (graph == null)
|
if (graph == null)
|
||||||
return null;
|
return null;
|
||||||
LogUtils.getLogger().info("finding path");
|
|
||||||
Couple<DiscoveredPath> results = Couple.create(null, null);
|
Couple<DiscoveredPath> results = Couple.create(null, null);
|
||||||
for (boolean forward : Iterate.trueAndFalse) {
|
for (boolean forward : Iterate.trueAndFalse) {
|
||||||
|
|
||||||
|
|
|
@ -541,14 +541,12 @@ public class Train {
|
||||||
if (!reservedSignalBlocks.isEmpty())
|
if (!reservedSignalBlocks.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GlobalStation destination = navigation.destination;
|
|
||||||
if (!navigatingManually && fullRefresh) {
|
if (!navigatingManually && fullRefresh) {
|
||||||
DiscoveredPath preferredPath = runtime.startCurrentInstruction();
|
DiscoveredPath preferredPath = runtime.startCurrentInstruction();
|
||||||
if (preferredPath != null)
|
if (preferredPath != null){
|
||||||
destination = preferredPath.destination;
|
navigation.startNavigation(preferredPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
navigation.startNavigation(navigation.findPathTo(destination, navigatingManually ? -1 : Double.MAX_VALUE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tickDerailedSlowdown() {
|
private void tickDerailedSlowdown() {
|
||||||
|
|
Loading…
Reference in a new issue