Skip to content

Commit b6d7238

Browse files
authored
Merge pull request #157 from DevKor-github/routeCut
Fix: cutRoute 버그 패치
2 parents 84b4ef1 + a7246bc commit b6d7238

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/devkor/com/teamcback/domain/routes/service/RouteService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ else if (!Objects.equals(thisNode.getFloor(), nextNode.getFloor())) {
423423
partialRoute.add(thisNode);
424424

425425
// 계단/엘리베이터를 통한 연속적인 층 이동을 감지하여 중간 층을 생략
426-
while (count < route.size() - 1 && !Objects.equals(thisNode.getFloor(), nextNode.getFloor())) {
426+
while (count < route.size() - 1 && !Objects.equals(thisNode.getFloor(), nextNode.getFloor()) && thisNode.getBuilding().equals(nextNode.getBuilding())) {
427427
thisNode = route.get(count);
428428
nextNode = route.get(count + 1);
429429
count++;
@@ -433,6 +433,7 @@ else if (!Objects.equals(thisNode.getFloor(), nextNode.getFloor())) {
433433

434434
// 끝 층의 시작 노드를 새 경로로 추가
435435
partialRoute.add(thisNode);
436+
count--;
436437
}
437438
else {
438439
partialRoute.add(thisNode);

0 commit comments

Comments
 (0)