… | |
… | |
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 | } |
|
|
2472 | # else put him there anyways for now #d# |
|
|
2473 | |
|
|
2474 | ($path, $x, $y) = ($ob->map, $ob->x, $ob->y); |
|
|
2475 | } |
|
|
2476 | } |
|
|
2477 | |
2463 | my $map = eval { |
2478 | my $map = eval { |
2464 | my $map = cf::map::find $path; |
2479 | my $map = cf::map::find $path; |
2465 | |
2480 | |
2466 | if ($map) { |
2481 | if ($map) { |
2467 | $map = $map->customise_for ($self); |
2482 | $map = $map->customise_for ($self); |