public final void setPos(int x, int y, boolean teleported) {
		if (animation != -1
				&& AnimationSequence.animations[animation].precedenceWalking == 1)
			animation = -1;
		if (!teleported) {
			int distanceX = x - waypointX[0];
			int distanceY = y - waypointY[0];
			if (distanceX >= -8 && distanceX <= 8 && distanceY >= -8
					&& distanceY <= 8) {
				if (waypointCount < 9)
					waypointCount++;
				for (int waypoint = waypointCount; waypoint > 0; waypoint--) {
					waypointX[waypoint] = waypointX[waypoint - 1];
					waypointY[waypoint] = waypointY[waypoint - 1];
					waypointRan[waypoint] = waypointRan[waypoint - 1];
				}

				waypointX[0] = x;
				waypointY[0] = y;
				waypointRan[0] = false;
				return;
			}
		}
		waypointCount = 0;
		stepsRemaining = 0;
		stepsDelayed = 0;
		waypointX[0] = x;
		waypointY[0] = y;
		this.x = waypointX[0] * 128 + boundaryDimension * 64;
		this.y = waypointY[0] * 128 + boundaryDimension * 64;
	}