on enlève que quand c'est dans la queue

This commit is contained in:
DylanVsn 2019-10-16 13:50:10 +02:00
parent 7a1ca1ef65
commit 0e3dfd140e

View File

@ -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: