… | |
… | |
28 | return unless %follow; |
28 | return unless %follow; |
29 | |
29 | |
30 | while (my ($name, $target) = each %follow) { |
30 | while (my ($name, $target) = each %follow) { |
31 | my ($who, $other) = (cf::player::find $name, cf::player::find $target); |
31 | my ($who, $other) = (cf::player::find $name, cf::player::find $target); |
32 | if ($who && $other) { |
32 | if ($who && $other) { |
33 | $who->ob->teleport ($other->ob->map, $other->ob->x, $other->ob->y); |
33 | $who->ob->teleport ($other->ob->map, $other->ob->x, $other->ob->y) |
|
|
34 | if $who->ob->map->path ne $other->ob->map->path; |
34 | } else { |
35 | } else { |
35 | warn "follow: $name or $target is gone, removing from follow list\n"; |
36 | warn "follow: $name or $target is gone, removing from follow list\n"; |
36 | delete $follow{$name}; |
37 | delete $follow{$name}; |
37 | } |
38 | } |
38 | } |
39 | } |