… | |
… | |
82 | mkdir cf::localdir . "/" . cf::tmpdir; |
82 | mkdir cf::localdir . "/" . cf::tmpdir; |
83 | mkdir cf::localdir . "/" . cf::uniquedir; |
83 | mkdir cf::localdir . "/" . cf::uniquedir; |
84 | mkdir $RANDOM_MAPS; |
84 | mkdir $RANDOM_MAPS; |
85 | |
85 | |
86 | our $EMERGENCY_POSITION; |
86 | our $EMERGENCY_POSITION; |
|
|
87 | |
|
|
88 | sub cf::map::normalise; |
87 | |
89 | |
88 | ############################################################################# |
90 | ############################################################################# |
89 | |
91 | |
90 | =head2 GLOBAL VARIABLES |
92 | =head2 GLOBAL VARIABLES |
91 | |
93 | |
… | |
… | |
1078 | for (@$files) { |
1080 | for (@$files) { |
1079 | utf8::decode $_; |
1081 | utf8::decode $_; |
1080 | next if /\.(?:pl|pst)$/; |
1082 | next if /\.(?:pl|pst)$/; |
1081 | next unless /^$PATH_SEP/o; |
1083 | next unless /^$PATH_SEP/o; |
1082 | |
1084 | |
1083 | s/\.map$//; |
|
|
1084 | push @paths, "~" . $pl->ob->name . "/" . $_; |
1085 | push @paths, cf::map::normalise "~" . $pl->ob->name . "/" . $_; |
1085 | } |
1086 | } |
1086 | |
1087 | |
1087 | \@paths |
1088 | \@paths |
1088 | } |
1089 | } |
1089 | |
1090 | |
… | |
… | |
1178 | sub normalise { |
1179 | sub normalise { |
1179 | my ($path, $base) = @_; |
1180 | my ($path, $base) = @_; |
1180 | |
1181 | |
1181 | $path = "$path"; # make sure its a string |
1182 | $path = "$path"; # make sure its a string |
1182 | |
1183 | |
|
|
1184 | $path =~ s/\.map$//; |
|
|
1185 | |
1183 | # map plan: |
1186 | # map plan: |
1184 | # |
1187 | # |
1185 | # /! non-realised random map exit (special hack!) |
1188 | # /! non-realised random map exit (special hack!) |
1186 | # {... are special paths that are not being touched |
1189 | # {... are special paths that are not being touched |
1187 | # ?xxx/... are special absolute paths |
1190 | # ?xxx/... are special absolute paths |
… | |
… | |
1628 | for (@$files) { |
1631 | for (@$files) { |
1629 | utf8::decode $_; |
1632 | utf8::decode $_; |
1630 | next if /\.pst$/; |
1633 | next if /\.pst$/; |
1631 | next unless /^$PATH_SEP/o; |
1634 | next unless /^$PATH_SEP/o; |
1632 | |
1635 | |
1633 | s/\.map$//; |
1636 | push @paths, cf::map::normalise $_; |
1634 | push @paths, $_; |
|
|
1635 | } |
1637 | } |
1636 | |
1638 | |
1637 | \@paths |
1639 | \@paths |
1638 | } |
1640 | } |
1639 | |
1641 | |