… | |
… | |
47 | |
47 | |
48 | my ($map, $x, $y) = ($target->map, $target->x, $target->y); |
48 | my ($map, $x, $y) = ($target->map, $target->x, $target->y); |
49 | |
49 | |
50 | # add new position to queue, if any |
50 | # add new position to queue, if any |
51 | push @$queue, [$map, $x, $y] |
51 | push @$queue, [$map, $x, $y] |
|
|
52 | if !@$queue |
52 | if $map != $queue->[-1][0] |
53 | || $map != $queue->[-1][0] |
53 | || $x != $queue->[-1][1] |
54 | || $x != $queue->[-1][1] |
54 | || $y != $queue->[-1][2]; |
55 | || $y != $queue->[-1][2]; |
55 | |
56 | |
56 | # try to move to oldest position |
57 | # try to move to oldest position |
57 | if (@$queue > $MAX_QUEUE) { |
58 | if (@$queue > $MAX_QUEUE) { |
58 | $who->message ($target->name . " is too far away - you can't follow anymore!"); |
59 | $who->message ($target->name . " is too far away - you can't follow anymore!"); |
59 | unfollow $target->name; |
60 | unfollow $target->name; |