diff --git a/src/commandSystem/BasicInstructionQueue.java b/src/commandSystem/BasicInstructionQueue.java index 7e54d7f..5f1b4f6 100644 --- a/src/commandSystem/BasicInstructionQueue.java +++ b/src/commandSystem/BasicInstructionQueue.java @@ -95,7 +95,8 @@ public class BasicInstructionQueue implements InstructionQueue { case REACHEDFLOORSIGNAL: currentFloor = event.getCurrentFloor(); currentDirection = event.getCurrentDirection(); - removeInstruction(currentFloor); + if (currentFloor == getNextInstruction()) + removeInstruction(currentFloor); break; default: