ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/bin/cfmap-plushify
(Generate patch)

Comparing deliantra/Deliantra/bin/cfmap-plushify (file contents):
Revision 1.12 by root, Wed Oct 28 10:17:01 2009 UTC vs.
Revision 1.13 by root, Wed Oct 28 10:55:38 2009 UTC

4#TODO: fix dialogue 4#TODO: fix dialogue
5#TODO: update file format version 5#TODO: update file format version
6 6
7# this script checks, fixes and simplifies @match expressions in a map 7# this script checks, fixes and simplifies @match expressions in a map
8 8
9use common::sense;
10
9use Deliantra; 11use Deliantra;
10use Deliantra::Map; 12use Deliantra::Map;
11 13
12load_archetypes; 14Deliantra::load_archetypes;
13 15
14our $dirty; 16our $dirty;
17our $path;
15 18
16sub fix_msg($) { 19sub fix_msg($) {
17 my ($msg) = @_; 20 my ($msg) = @_;
18 21
19 local $_ = $msg; 22 local $_ = $msg;
43 46
44 $_ 47 $_
45} 48}
46 49
47sub patch_arch($) { 50sub patch_arch($) {
51 warn "$path: references unknown archetype $_[0]{_name}\n"
52 unless exists $ARCH{ $_[0]{_name} };
53
48 if ($_[0]{face} =~ /\.[1-9]\d\d$/) { 54 if ($_[0]{face} =~ /\.[1-9]\d\d$/) {
49 $_[0]{face} =~ s/\.([2-9])\1\1$/.x1$1/; # 222, 333, 444 55 $_[0]{face} =~ s/\.([2-9])\1\1$/.x1$1/; # 222, 333, 444
50 $_[0]{face} =~ s/\.1(\d\d)$/.x$1/; # 1AB xAB 56 $_[0]{face} =~ s/\.1(\d\d)$/.x$1/; # 1AB xAB
51 $dirty++; 57 $dirty++;
52 }
53
54 unless (exists $ARCH{ $_[0]{_name} }) {
55 die "$_[0]{_name}\n";#d#
56 } 58 }
57} 59}
58 60
59sub patch_inv($) { 61sub patch_inv($) {
60 my ($arch) = @_; 62 my ($arch) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines