--- cf.schmorp.de/maps/perl/follow.ext 2006/08/25 15:12:21 1.21 +++ cf.schmorp.de/maps/perl/follow.ext 2006/12/15 19:06:29 1.26 @@ -15,9 +15,9 @@ my $portal = cf::object::new "exit"; - $portal->set_slaying ($map); - $portal->set_hp ($x); - $portal->set_sp ($y); + $portal->slaying ($map); + $portal->stats->hp ($x); + $portal->stats->sp ($y); $portal->apply ($pl->ob); @@ -26,7 +26,7 @@ my %follow; -my $timer = Event->timer (interval => 0.2, parked => 1, cb => sub { +my $timer = Event->timer (interval => 0.2, parked => 1, data => cf::WF_AUTOCANCEL, cb => sub { while (my ($name, $v) = each %follow) { my ($target, $his, $mine) = @$v; my ($who, $other) = (cf::player::find $name, cf::player::find $target); @@ -41,7 +41,7 @@ my $map; - if ($map = cf::map::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])) { teleport $who, @$mine; @@ -58,7 +58,7 @@ $_[0]->w->stop unless keys %follow; }); -cf::register_command follow => 0, sub { +cf::register_command follow => sub { my ($who, $args) = @_; my $name = $who->name;