Correct the height levels of steps in a path

Makes sure that the steps in a path sent for a "Player Walk" message are
on the same level as the players current position while being processed
in the walking queue.
This commit is contained in:
Gary Tierney
2015-12-22 03:56:38 +00:00
parent 7eab485447
commit 68db45e9d3
@@ -122,6 +122,7 @@ public final class WalkingQueue {
*/
public void pulse() {
Position position = mob.getPosition();
int height = position.getHeight();
Direction firstDirection = Direction.NONE;
Direction secondDirection = Direction.NONE;
@@ -130,14 +131,14 @@ public final class WalkingQueue {
if (next != null) {
previousPoints.add(next);
firstDirection = Direction.between(position, next);
position = next;
position = new Position(next.getX(), next.getY(), height);
if (running) {
next = points.poll();
if (next != null) {
previousPoints.add(next);
secondDirection = Direction.between(position, next);
position = next;
position = new Position(next.getX(), next.getY(), height);
}
}
}