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

Comparing deliantra/maps/perl/follow.ext (file contents):
Revision 1.2 by root, Fri Feb 3 22:52:51 2006 UTC vs.
Revision 1.3 by root, Sat Feb 4 00:33:07 2006 UTC

20 $who->message ("follow mode off"); 20 $who->message ("follow mode off");
21 delete $follow{$name}; 21 delete $follow{$name};
22 } 22 }
23}; 23};
24 24
25sub teleport {
26 my ($pl, $map, $x, $y) = @_;
27
28 my $portal = cf::object::new ("exit");
29
30 $portal->set_slaying ($map->path);
31 $portal->set_hp ($x);
32 $portal->set_sp ($y);
33
34 $portal->apply ($pl->ob, 0);
35
36 $portal->free;
37}
38
25sub on_clock { 39sub on_clock {
26 my ($event) = @_; 40 my ($event) = @_;
27 41
28 return unless %follow; 42 return unless %follow;
29 43
30 while (my ($name, $target) = each %follow) { 44 while (my ($name, $target) = each %follow) {
31 my ($who, $other) = (cf::player::find $name, cf::player::find $target); 45 my ($who, $other) = (cf::player::find $name, cf::player::find $target);
32 if ($who && $other) { 46 if ($who && $other) {
33 $who->ob->teleport ($other->ob->map, $other->ob->x, $other->ob->y) 47 teleport $who, $other->ob->map, $other->ob->x, $other->ob->y
34 if $who->ob->map->path ne $other->ob->map->path; 48 if $who->ob->map->path ne $other->ob->map->path;
35 } else { 49 } else {
36 warn "follow: $name or $target is gone, removing from follow list\n"; 50 warn "follow: $name or $target is gone, removing from follow list\n";
37 delete $follow{$name}; 51 delete $follow{$name};
38 } 52 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines