… | |
… | |
2458 | my $gen = $self->{_goto_generation} = ++$GOTOGEN; |
2458 | my $gen = $self->{_goto_generation} = ++$GOTOGEN; |
2459 | |
2459 | |
2460 | $self->enter_link; |
2460 | $self->enter_link; |
2461 | |
2461 | |
2462 | (async { |
2462 | (async { |
|
|
2463 | # *tag paths override both path and x|y |
|
|
2464 | if ($path =~ /^\*(.*)$/) { |
|
|
2465 | if (my @obs = grep $_->map, ext::map_tags::find $1) { |
|
|
2466 | my $ob = $obs[rand @obs]; |
|
|
2467 | |
|
|
2468 | # see if we actually can go there |
|
|
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# |
|
|
2475 | |
|
|
2476 | ($path, $x, $y) = ($ob->map, $ob->x, $ob->y); |
|
|
2477 | } else { |
|
|
2478 | ($path, $x, $y) = (undef, undef, undef); |
|
|
2479 | } |
|
|
2480 | } |
|
|
2481 | |
2463 | my $map = eval { |
2482 | my $map = eval { |
2464 | my $map = cf::map::find $path; |
2483 | my $map = defined $path ? cf::map::find $path : undef; |
2465 | |
2484 | |
2466 | if ($map) { |
2485 | if ($map) { |
2467 | $map = $map->customise_for ($self); |
2486 | $map = $map->customise_for ($self); |
2468 | $map = $check->($map) if $check && $map; |
2487 | $map = $check->($map) if $check && $map; |
2469 | } else { |
2488 | } else { |
2470 | $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); |
2471 | } |
2490 | } |
2472 | |
2491 | |
2473 | $map |
2492 | $map |
2474 | }; |
2493 | }; |
2475 | |
2494 | |