ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.367 by root, Wed Sep 12 11:10:11 2007 UTC vs.
Revision 1.369 by root, Thu Sep 13 08:35:25 2007 UTC

2464 if ($path =~ /^\*(.*)$/) { 2464 if ($path =~ /^\*(.*)$/) {
2465 if (my @obs = grep $_->map, ext::map_tags::find $1) { 2465 if (my @obs = grep $_->map, ext::map_tags::find $1) {
2466 my $ob = $obs[rand @obs]; 2466 my $ob = $obs[rand @obs];
2467 2467
2468 # see if we actually can go there 2468 # see if we actually can go there
2469 # todo: use ob_blocked to check all tiles of the destination "object" 2469 if (@obs = grep !$self->blocked ($_->map, $_->x, $_->y), $ob, $ob->tail) {
2470 # for suitability. 2470 $ob = $obs[rand @obs];
2471 } else {
2472 $self->message ("Wow, it's pretty crowded in there.", cf::NDI_UNIQUE | cf::NDI_RED);
2473 }
2474 # else put us there anyways for now #d#
2471 2475
2472 ($path, $x, $y) = ($ob->map, $ob->x, $ob->y); 2476 ($path, $x, $y) = ($ob->map, $ob->x, $ob->y);
2477 } else {
2478 ($path, $x, $y) = (undef, undef, undef);
2473 } 2479 }
2474 } 2480 }
2475 2481
2476 my $map = eval { 2482 my $map = eval {
2477 my $map = cf::map::find $path; 2483 my $map = defined $path ? cf::map::find $path : undef;
2478 2484
2479 if ($map) { 2485 if ($map) {
2480 $map = $map->customise_for ($self); 2486 $map = $map->customise_for ($self);
2481 $map = $check->($map) if $check && $map; 2487 $map = $check->($map) if $check && $map;
2482 } else { 2488 } else {
2483 $self->message ("The exit to '$path' is closed", cf::NDI_UNIQUE | cf::NDI_RED); 2489 $self->message ("The exit to '$path' is closed.", cf::NDI_UNIQUE | cf::NDI_RED);
2484 } 2490 }
2485 2491
2486 $map 2492 $map
2487 }; 2493 };
2488 2494

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines