… | |
… | |
40 | cf::wait_for_tick; |
40 | cf::wait_for_tick; |
41 | |
41 | |
42 | for (values %FOLLOW) { |
42 | for (values %FOLLOW) { |
43 | my ($who, $target, $queue) = @$_; |
43 | my ($who, $target, $queue) = @$_; |
44 | |
44 | |
|
|
45 | $target->active |
|
|
46 | or next; |
|
|
47 | |
45 | my ($map, $x, $y) = ($target->map, $target->x, $target->y); |
48 | my ($map, $x, $y) = ($target->map, $target->x, $target->y); |
46 | |
49 | |
47 | # add new position to queue, if any |
50 | # add new position to queue, if any |
48 | push @$queue, [$map, $x, $y] |
51 | push @$queue, [$map, $x, $y] |
49 | if $map != $queue->[-1][0] |
52 | if $map != $queue->[-1][0] |
… | |
… | |
52 | |
55 | |
53 | # try to move to oldest position |
56 | # try to move to oldest position |
54 | if (@$queue > $MAX_QUEUE) { |
57 | if (@$queue > $MAX_QUEUE) { |
55 | $who->message ($target->name . " is too far away - you can't follow anymore!"); |
58 | $who->message ($target->name . " is too far away - you can't follow anymore!"); |
56 | unfollow $target->name; |
59 | unfollow $target->name; |
57 | } else { |
60 | } elsif (@$queue) { |
58 | my ($map, $x, $y) = @{ $queue->[0] }; |
61 | my ($map, $x, $y) = @{ $queue->[0] }; |
59 | |
62 | |
60 | $map->load; |
63 | $map->load; |
61 | |
64 | |
62 | if ( |
65 | if ( |