diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteOverlap.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteOverlap.java index c98a934c4..c2bf0357d 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteOverlap.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/RouteOverlap.java @@ -98,18 +98,23 @@ public class RouteOverlap extends MapNamedElement { public void releaseImmediately() { if (!CollectionUtils.isEmpty(this.pathList)) { for (SectionPath path : this.pathList) { + List flsList = path.getFlsList(); for (SwitchElement element : path.getSwitchList()) { - element.getASwitch().overlapUnLock(); + Switch aSwitch = element.getASwitch(); + aSwitch.overlapUnLock(); + if (!CollectionUtils.isEmpty(flsList)) { + for (RouteFls routeFls : flsList) { + if (routeFls.getBase().getASwitch().equals(aSwitch) && + !aSwitch.isRouteLock()) { + routeFls.unlock(); + } + } + } } for (Section section1 : path.getSectionList()) { section1.overlapUnlocking(); } - List flsList = path.getFlsList(); - if (!CollectionUtils.isEmpty(flsList)) { - for (RouteFls routeFls : flsList) { - routeFls.unlock(); - } - } + } } this.forbidden = true;