From 08166c0304d3286af9d26f9eea13bfa0d9cfcec5 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 13 Dec 2018 12:09:01 +0000 Subject: [PATCH] Update RoverActivity.java Fixes issue which results in the lastMoveCompleted is left in the moves array --- .../main/java/com/mongodb/stitch/rover/RoverActivity.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/mongodb/stitch/rover/RoverActivity.java b/app/src/main/java/com/mongodb/stitch/rover/RoverActivity.java index 8ca0289..e3dc43c 100644 --- a/app/src/main/java/com/mongodb/stitch/rover/RoverActivity.java +++ b/app/src/main/java/com/mongodb/stitch/rover/RoverActivity.java @@ -249,9 +249,10 @@ public Rover resolveConflict( for (final Move move : remoteRover.getMoves()) { if (move.getId().equals(lastMoveCompleted)) { caughtUp = true; - } - if (caughtUp) { - nextMoves.add(move); + } else { + if (caughtUp) { + nextMoves.add(move); + } } } return new Rover(localRover, nextMoves);