diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteFls.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteFls.java index d8d1858e1..ccdcf7cd6 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteFls.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteFls.java @@ -64,11 +64,11 @@ public class RouteFls { public void lock() { for (FlsElement flsElement : this.getLevel1List()) { SwitchElement pSwitch = flsElement.getPSwitch(); - if (pSwitch != null && !pSwitch.getASwitch().isSectionOccupied()) { + if (pSwitch != null && (pSwitch.isOnPosition() || !pSwitch.getASwitch().isSectionOccupied())) { pSwitch.getASwitch().fpLock(); } else { SwitchElement fpae = flsElement.getFpae(); - if (fpae != null && !fpae.getASwitch().isSectionOccupied()) { + if (fpae != null && (fpae.isOnPosition() || !fpae.getASwitch().isSectionOccupied())) { fpae.getASwitch().fpLock(); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SwitchElement.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SwitchElement.java index 36f472eb6..4633548ec 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SwitchElement.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/SwitchElement.java @@ -34,4 +34,8 @@ public class SwitchElement { } return true; } + + public boolean isOnPosition() { + return this.aSwitch.isOnPosition(this.isNormal()); + } }