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

Comparing deliantra/Deliantra/bin/cfmap-tagify (file contents):
Revision 1.4 by root, Tue Sep 18 19:03:23 2007 UTC vs.
Revision 1.5 by root, Tue Apr 8 20:26:32 2008 UTC

4# tags that point to one of the maps given on the commandline 4# tags that point to one of the maps given on the commandline
5# (which must be relative paths starting at .!) 5# (which must be relative paths starting at .!)
6 6
7use strict; 7use strict;
8 8
9use Crossfire; 9use Deliantra;
10use Crossfire::Map; 10use Deliantra::Map;
11use Tie::Cache; 11use Tie::Cache;
12use Errno; 12use Errno;
13 13
14{ 14{
15 package mapcache; 15 package mapcache;
16 16
17 use base Tie::Cache::; 17 use base Tie::Cache::;
18 18
19 sub read { 19 sub read {
20 my $map = eval { 20 my $map = eval {
21 new_from_file Crossfire::Map $_[1] 21 new_from_file Deliantra::Map $_[1]
22 }; 22 };
23 23
24 if ($@) { 24 if ($@) {
25 die unless $@ =~ /No such file or directory/; 25 die unless $@ =~ /No such file or directory/;
26 warn $@; 26 warn $@;
40 40
41our %map; 41our %map;
42tie %map, mapcache::, 100, { Debug => 0, WriteSync => 0 } 42tie %map, mapcache::, 100, { Debug => 0, WriteSync => 0 }
43 or die; 43 or die;
44 44
45Crossfire::load_archetypes; 45Deliantra::load_archetypes;
46 46
47sub expand { 47sub expand {
48 my ($path, $base) = @_; 48 my ($path, $base) = @_;
49 49
50 $path =~ s/\.map$//; 50 $path =~ s/\.map$//;
139 for my $fy (0 .. $map->{info}{height} - 1) { 139 for my $fy (0 .. $map->{info}{height} - 1) {
140 my $space = $map->{map}[$fx][$fy] 140 my $space = $map->{map}[$fx][$fy]
141 or next; 141 or next;
142 142
143 for my $o (@$space) { 143 for my $o (@$space) {
144 my $a = $Crossfire::ARCH{$o->{_name}} 144 my $a = $Deliantra::ARCH{$o->{_name}}
145 or next; 145 or next;
146 146
147 if ($is_exit{$o->{type} || $a->{type}}) { 147 if ($is_exit{$o->{type} || $a->{type}}) {
148 my ($exit, $x, $y) = ($o->{slaying}, $o->{hp}, $o->{sp}); 148 my ($exit, $x, $y) = ($o->{slaying}, $o->{hp}, $o->{sp});
149 if ($exit =~ /^[\/0-9a-zA-Z\.]/ && $exit ne "/!") { 149 if ($exit =~ /^[\/0-9a-zA-Z\.]/ && $exit ne "/!") {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines