1 |
#! perl |
2 |
|
3 |
# this script loads all unique-item maps and removes unique exits on them, |
4 |
# because the new map file format does not have a need for exits to be marked unique. |
5 |
|
6 |
cf::async { |
7 |
my $maps = Coro::AIO::aio_readdir "/var/crossfire/unique-items"; |
8 |
for my $mapname (grep !/\.pst$/, @$maps) { |
9 |
$mapname =~ s/∕/\//g; |
10 |
my $map = cf::map::find_map $mapname or next; |
11 |
$map->load; |
12 |
|
13 |
for my $x (0.. $map->width - 1) { |
14 |
for my $y (0.. $map->height - 1) { |
15 |
for my $ob (grep $_->type == 66, $map->at ($x, $y)) { |
16 |
$ob->destroy |
17 |
if $ob->flag (cf::FLAG_UNIQUE); |
18 |
} |
19 |
} |
20 |
} |
21 |
|
22 |
Coro::Timer::sleep 0.2; |
23 |
} |
24 |
}; |
25 |
|
26 |
1 |