ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/util/rmuniq
Revision: 1.3
Committed: Wed Jan 3 13:07:26 2007 UTC (17 years, 4 months ago) by root
Branch: MAIN
CVS Tags: rel-2_2, rel-2_0, rel-2_1, HEAD
Changes since 1.2: +3 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
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