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.366 by root, Tue Sep 11 16:05:35 2007 UTC vs.
Revision 1.369 by root, Thu Sep 13 08:35:25 2007 UTC

2463 # *tag paths override both path and x|y 2463 # *tag paths override both path and x|y
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 # todo: use ob_blocked to check all tiles of the destination "object" 2468 # see if we actually can go there
2469 # for suitability. 2469 if (@obs = grep !$self->blocked ($_->map, $_->x, $_->y), $ob, $ob->tail) {
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#
2470 2475
2471 ($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);
2472 } 2479 }
2473 } 2480 }
2474 2481
2475 my $map = eval { 2482 my $map = eval {
2476 my $map = cf::map::find $path; 2483 my $map = defined $path ? cf::map::find $path : undef;
2477 2484
2478 if ($map) { 2485 if ($map) {
2479 $map = $map->customise_for ($self); 2486 $map = $map->customise_for ($self);
2480 $map = $check->($map) if $check && $map; 2487 $map = $check->($map) if $check && $map;
2481 } else { 2488 } else {
2482 $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);
2483 } 2490 }
2484 2491
2485 $map 2492 $map
2486 }; 2493 };
2487 2494

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines