--- cfmaps/cfmap2html 2005/11/20 01:05:34 1.10
+++ cfmaps/cfmap2html 2005/11/20 03:31:58 1.11
@@ -17,7 +17,7 @@
# along with gvpe; if not, write to the Free Software
# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-our $VERSION = '1.05';
+our $VERSION = '1.11';
use Storable;
@@ -28,8 +28,6 @@
my $arch;
-umask 022;
-
sub escape_html($) {
local $_ = shift;
s/([<>&])/sprintf "%d;", ord $1/ge;
@@ -51,8 +49,8 @@
$arch ||= Storable::retrieve "$LIBDIR/archetypes.pst";
my $meta = Storable::retrieve "$path.pst";
- open my $fh, ">:utf8", "$path.html"
- or die "$path.html: $!";
+ open my $fh, ">:utf8", "$path.xhtml"
+ or die "$path.xhtml: $!";
select $fh;
@@ -61,11 +59,12 @@
my (@path) = split /\//, $path;
- print "",
- "",
+ print "",
+ "",
+ "",
"
",
"Crossfire Map \"$path\"",
- "",
+ "",
"",
"";
@@ -106,9 +105,10 @@
print "$path[$_] / ";
}
+ my @dir = qw(none up right down left);
my @tile = map {
$meta->{info}{"tile_path_$_"}
- ? ""
+ ? ""
: ""
} 1..4;
#"}"# vim misparses without this comment
@@ -149,18 +149,18 @@
my $aname = escape_html $a->{_name};
my $name = escape_html $a->{name} || $o->{name};
- print "$aname \"$name\"\n";
+ print "$aname \"$name\"\n";
for (sort keys %$a) {
next if $ignore{$_};
my $v = escape_html $a->{$_};
- if (($type == 66 || $type == 41) && $_ eq "slaying") { # door, teleporter
+ if ($_ eq "slaying" && ($type == 41 || $type == 57 || $type == 66)) { # door, teleporter, player_changer
$a->{msg} =~ /^final_map\s*(\S+)\s*$/m, $v = $1
if $v eq "/!"; # random map
- print "slaying => $v\n";
+ print "slaying => $v\n";
} elsif ($_ eq "other_arch") {
- print "$_ => $v\n";
+ print "$_ => $v\n";
} elsif ($_ eq "inventory") {
print "inventory =>\n";
print_archs ($a->{$_});
@@ -190,6 +190,6 @@
close $fh;
- system "gzip", "-7f", "$path.html";
+ system "gzip", "-7f", "$path.xhtml";
}