Skip to content

Commit

Permalink
Insert in proper position
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Oct 12, 2020
1 parent 1d314fb commit 6a3382c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ public void onPlayerInteract(PlayerInteractEvent event) {

Waypoint element = new Waypoint(at);
normaliseEditingSlot();
if (editingSlot == waypoints.size()) {
if (editingSlot + 1 >= waypoints.size()) {
waypoints.add(element);
} else {
waypoints.add(editingSlot, element);
waypoints.add(editingSlot + 1, element);
}
if (showPath) {
markers.createMarker(element, element.getLocation().clone().add(0, 1, 0));
Expand Down

0 comments on commit 6a3382c

Please sign in to comment.