--- deliantra/server/lib/cf.pm 2007/09/11 16:05:35 1.366 +++ deliantra/server/lib/cf.pm 2007/09/13 08:35:25 1.369 @@ -2465,21 +2465,28 @@ if (my @obs = grep $_->map, ext::map_tags::find $1) { my $ob = $obs[rand @obs]; - # todo: use ob_blocked to check all tiles of the destination "object" - # for suitability. + # see if we actually can go there + if (@obs = grep !$self->blocked ($_->map, $_->x, $_->y), $ob, $ob->tail) { + $ob = $obs[rand @obs]; + } else { + $self->message ("Wow, it's pretty crowded in there.", cf::NDI_UNIQUE | cf::NDI_RED); + } + # else put us there anyways for now #d# ($path, $x, $y) = ($ob->map, $ob->x, $ob->y); + } else { + ($path, $x, $y) = (undef, undef, undef); } } my $map = eval { - my $map = cf::map::find $path; + my $map = defined $path ? cf::map::find $path : undef; if ($map) { $map = $map->customise_for ($self); $map = $check->($map) if $check && $map; } else { - $self->message ("The exit to '$path' is closed", cf::NDI_UNIQUE | cf::NDI_RED); + $self->message ("The exit to '$path' is closed.", cf::NDI_UNIQUE | cf::NDI_RED); } $map