--- deliantra/server/ext/minesweeper.ext 2006/12/15 19:29:18 1.1 +++ deliantra/server/ext/minesweeper.ext 2007/09/30 16:24:30 1.6 @@ -1,4 +1,4 @@ -#! perl +#! perl # mandatory use Scalar::Util; @@ -9,10 +9,12 @@ if (my $teleport = $ob->{options}{"teleport_$status"}) { my ($x, $y, $damned) = split /,/, $teleport; - my $pl = cf::player::find $ob->{player}; + my $pl = cf::player::find_active $ob->{player}; - $pl->ob->transfer ($x, $y); - $pl->savebed ($pl->ob->map->path, $x, $y) + my $path = $pl->ob->map->path; + + $pl->ob->goto ($path, $x, $y); + $pl->savebed ($path, $x, $y) if $ob->{options}{"set_savebed_$status"}; } } @@ -62,7 +64,7 @@ 1 } -cf::register_attachment minesweeper => +cf::object::attachment minesweeper => on_tick => sub { my ($self) = @_; @@ -119,7 +121,7 @@ }, ; -cf::register_attachment minesweeper_field => +cf::object::attachment minesweeper_field => on_apply => sub { my ($ob, $who) = @_;