--- deliantra/server/lib/cf.pm 2007/01/08 12:39:16 1.148 +++ deliantra/server/lib/cf.pm 2007/01/08 23:36:16 1.153 @@ -1121,8 +1121,12 @@ my $guard = cf::lock_acquire "user_find:$login"; - $cf::PLAYER{$login} ||= (load_pl path $login or return); - }; + $cf::PLAYER{$_[0]} || do { + my $pl = load_pl path $login + or return; + $cf::PLAYER{$login} = $pl + } + } } sub save($) { @@ -1168,12 +1172,10 @@ my $path = playerdir $pl; my $temp = "$path~$cf::RUNTIME~deleting~"; - IO::AIO::aio_rename $path, $temp, sub { - delete $cf::PLAYER{$pl->ob->name}; - $pl->destroy; - - IO::AIO::aio_rmtree $temp; - }; + Coro::AIO::aio_rename $path, $temp; + delete $cf::PLAYER{$pl->ob->name}; + $pl->destroy; + IO::AIO::aio_rmtree $temp; } =item $player->ext_reply ($msgid, $msgtype, %msg) @@ -1671,18 +1673,19 @@ sub cf::object::player::goto { my ($self, $path, $x, $y) = @_; + $path = new cf::path $path; + $path ne "/" or Carp::cluck ("oy");#d# + $self->enter_link; (async { - $path = new cf::path $path; - my $map = cf::map::find $path->as_string; $map = $map->customise_for ($self) if $map; # warn "entering ", $map->path, " at ($x, $y)\n" # if $map; - $map or $self->message ("The exit is closed", cf::NDI_UNIQUE | cf::NDI_RED); + $map or $self->message ("The exit to '" . ($path->visible_name) . "' is closed", cf::NDI_UNIQUE | cf::NDI_RED); $self->leave_link ($map, $x, $y); })->prio (1);