ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/follow.ext
(Generate patch)

Comparing deliantra/server/ext/follow.ext (file contents):
Revision 1.4 by root, Mon Jan 1 21:19:52 2007 UTC vs.
Revision 1.5 by root, Tue Jan 2 08:26:41 2007 UTC

13 while (my ($name, $v) = each %follow) { 13 while (my ($name, $v) = each %follow) {
14 my ($target, $his, $mine) = @$v; 14 my ($target, $his, $mine) = @$v;
15 my ($who, $other) = (cf::player::find $name, cf::player::find $target); 15 my ($who, $other) = (cf::player::find $name, cf::player::find $target);
16 16
17 if ($who && $other && $other->ob->map) { 17 if ($who && $other && $other->ob->map) {
18 my ($map, $x, $y) = ($other->ob->map, $other->ob->x, $other->ob->y); 18 my ($map, $x, $y) = ($other->ob->map->path, $other->ob->x, $other->ob->y);
19 19
20 if ($map ne $his->[0] || $x != $his->[1] || $y != $his->[2]) { 20 if ($map ne $his->[0] || $x != $his->[1] || $y != $his->[2]) {
21 @$mine = @$his; 21 @$mine = @$his;
22 @$his = ($map, $x, $y); 22 @$his = ($map, $x, $y);
23 } 23 }
47 47
48 my $name = $who->name; 48 my $name = $who->name;
49 49
50 if ($args ne "" && $name ne $args) { 50 if ($args ne "" && $name ne $args) {
51 if (my $other = cf::player::find $args) { 51 if (my $other = cf::player::find $args) {
52 if ($other->ob->map->path eq $who->map->path 52 if ($other->ob->map eq $who->map
53 && abs ($other->ob->x - $who->x) <= 1 53 && abs ($other->ob->x - $who->x) <= 1
54 && abs ($other->ob->y - $who->y) <= 1) { 54 && abs ($other->ob->y - $who->y) <= 1) {
55 $who->message ("Following player '$args', to stop, type: 'follow"); 55 $who->message ("Following player '$args', to stop, type: 'follow");
56 $other->ob->message ("$name is now following your every step..."); 56 $other->ob->message ("$name is now following your every step...");
57 $follow{$name} = [ 57 $follow{$name} = [

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines