--- deliantra/server/ext/follow.ext 2007/01/01 21:19:52 1.4 +++ deliantra/server/ext/follow.ext 2007/01/14 18:00:34 1.9 @@ -12,10 +12,10 @@ cf::sync_job { while (my ($name, $v) = each %follow) { my ($target, $his, $mine) = @$v; - my ($who, $other) = (cf::player::find $name, cf::player::find $target); + my ($who, $other) = (cf::player::find_active $name, cf::player::find_active $target); if ($who && $other && $other->ob->map) { - my ($map, $x, $y) = ($other->ob->map, $other->ob->x, $other->ob->y); + my ($map, $x, $y) = ($other->ob->map->path, $other->ob->x, $other->ob->y); if ($map ne $his->[0] || $x != $his->[1] || $y != $his->[2]) { @$mine = @$his; @@ -24,10 +24,10 @@ my $map; - if ($map = cf::map::find_map $mine->[0] + if ($map = cf::map::find $mine->[0] and !grep $_->flag (cf::FLAG_UNIQUE) && $_->flag (cf::FLAG_IS_FLOOR), $map->at ($mine->[1], $mine->[2])) { - $who->ob->goto_map (@$mine); + $who->ob->goto (@$mine); } else { delete $follow{$name}; $who->ob->message ("You can't follow $target anymore!"); @@ -48,8 +48,8 @@ my $name = $who->name; if ($args ne "" && $name ne $args) { - if (my $other = cf::player::find $args) { - if ($other->ob->map->path eq $who->map->path + if (my $other = cf::player::find_active $args) { + if ($other->ob->map == $who->map && abs ($other->ob->x - $who->x) <= 1 && abs ($other->ob->y - $who->y) <= 1) { $who->message ("Following player '$args', to stop, type: 'follow");