… | |
… | |
122 | while (defined (my $path = do { local $/ = "\x00"; <$fh> })) { |
122 | while (defined (my $path = do { local $/ = "\x00"; <$fh> })) { |
123 | chop $path; |
123 | chop $path; |
124 | my $map = $map{$path}; |
124 | my $map = $map{$path}; |
125 | |
125 | |
126 | for my $fx (0 .. $map->{info}{width} - 1) { |
126 | for my $fx (0 .. $map->{info}{width} - 1) { |
127 | for my $fy (0 .. $map->{info}{width} - 1) { |
127 | for my $fy (0 .. $map->{info}{height} - 1) { |
128 | my $space = $map->{map}[$fx][$fy] |
128 | my $space = $map->{map}[$fx][$fy] |
129 | or next; |
129 | or next; |
130 | |
130 | |
131 | for my $o (@$space) { |
131 | for my $o (@$space) { |
132 | my $a = $Crossfire::ARCH{$o->{_name}} |
132 | my $a = $Crossfire::ARCH{$o->{_name}} |
133 | or next; |
133 | or next; |
134 | |
134 | |
135 | if ($is_exit{$o->{type} || $a->{type}}) { |
135 | if ($is_exit{$o->{type} || $a->{type}}) { |
136 | my ($exit, $x, $y) = ($o->{slaying}, $o->{hp}, $o->{sp}); |
136 | my ($exit, $x, $y) = ($o->{slaying}, $o->{hp}, $o->{sp}); |
137 | if ($exit =~ /^[\/0-9a-zA-Z]/ && $exit ne "/!") { |
137 | if ($exit =~ /^[\/0-9a-zA-Z\.]/ && $exit ne "/!") { |
138 | $exit = expand $exit, $path; |
138 | $exit = expand $exit, $path; |
139 | if ($exit ne $path && ($target{$path} || $target{$exit} || 0)) { |
139 | if ($exit ne $path && ($target{$path} || $target{$exit} || 0)) { |
140 | if (my $tag = patch_exit $path, $fx, $fy, $exit, $x, $y) { |
140 | if (my $tag = patch_exit $path, $fx, $fy, $exit, $x, $y) { |
141 | delete $o->{sp}; |
141 | delete $o->{sp}; |
142 | delete $o->{hp}; |
142 | delete $o->{hp}; |