Fix NoSuchElementException in Room cycle

This commit is contained in:
Alejandro 2019-05-27 13:39:50 +03:00
parent b198d731c5
commit 540d401838

View File

@ -173,6 +173,8 @@ public class RoomUnit {
Deque<RoomTile> peekPath = room.getLayout().findPath(this.currentLocation, this.path.peek(), this.goalLocation, this);
if (peekPath.size() >= 3) {
if (path.isEmpty()) return true;
path.pop();
//peekPath.pop(); //Start
peekPath.removeLast(); //End