--- deliantra/server/lib/cf.pm 2007/01/01 16:00:10 1.114 +++ deliantra/server/lib/cf.pm 2007/01/01 17:30:34 1.116 @@ -1145,6 +1145,7 @@ $map->path ($key); $map->{path} = $path; + $map->{last_save} = $cf::RUNTIME; $map->last_access ($cf::RUNTIME); if ($map->should_reset) { @@ -1385,6 +1386,24 @@ : $cf::CFG{"may_$access"}) } +=item $player_object->enter_link + +Freezes the player and moves him/her to a special map (C<{link}>). + +The player should be reaosnably safe there for short amounts of time. You +I call C as soon as possible, though. + +=item $player_object->leave_link ($map, $x, $y) + +Moves the player out of the specila link map onto the given map. If the +map is not valid (or omitted), the player will be moved back to the +location he/she was before the call to C, or, if that fails, +to the emergency map position. + +Might block. + +=cut + sub cf::object::player::enter_link { my ($self) = @_; @@ -1403,8 +1422,6 @@ my $link_pos = delete $self->{_link_pos}; unless ($map) { - $self->message ("The exit is closed", cf::NDI_UNIQUE | cf::NDI_RED); - # restore original map position ($map, $x, $y) = @{ $link_pos || [] }; $map = cf::map::find_map $map; @@ -1447,6 +1464,8 @@ warn "entering ", $map->path, " at ($x, $y)\n" if $map; + $map or $self->message ("The exit is closed", cf::NDI_UNIQUE | cf::NDI_RED); + $self->leave_link ($map, $x, $y); })->prio (1); } @@ -1866,7 +1885,7 @@ sub main { # we must not ever block the main coroutine local $Coro::idle = sub { - Carp::cluck "FATAL: Coro::idle was called, major BUG\n";#d# + Carp::cluck "FATAL: Coro::idle was called, major BUG, use cf::sync_job!\n";#d# (Coro::unblock_sub { Event::one_event; })->();