… | |
… | |
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 | } |
|
|
2472 | # else put him there anyways for now #d# |
2471 | |
2473 | |
2472 | ($path, $x, $y) = ($ob->map, $ob->x, $ob->y); |
2474 | ($path, $x, $y) = ($ob->map, $ob->x, $ob->y); |
2473 | } |
2475 | } |
2474 | } |
2476 | } |
2475 | |
2477 | |