ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-world.ext
(Generate patch)

Comparing deliantra/server/ext/map-world.ext (file contents):
Revision 1.23 by root, Wed Apr 18 17:32:06 2007 UTC vs.
Revision 1.26 by root, Sat Apr 21 16:56:32 2007 UTC

122 $self->tile_path (3, sprintf "/world/world_%03d_%03d", $x - 1, $y) if $x > 0; 122 $self->tile_path (3, sprintf "/world/world_%03d_%03d", $x - 1, $y) if $x > 0;
123 123
124 $self->{load_path} = sprintf "%s/world-overlay/world_%03d_%03d.map", $cf::MAPDIR, $x, $y 124 $self->{load_path} = sprintf "%s/world-overlay/world_%03d_%03d.map", $cf::MAPDIR, $x, $y
125 if $x >= 100 && $x <= 129 && $y >= 100 && $y <= 129; 125 if $x >= 100 && $x <= 129 && $y >= 100 && $y <= 129;
126 126
127 $self->{need_create_treasure} = 1;
128
127 1 129 1
128} 130}
129 131
130sub fill { 132sub fill {
131 my ($self) = @_; 133 my ($self) = @_;
141 $self->SUPER::load; 143 $self->SUPER::load;
142 } else { 144 } else {
143 $self->alloc; 145 $self->alloc;
144 $self->fill; 146 $self->fill;
145 $self->in_memory (cf::MAP_IN_MEMORY); 147 $self->in_memory (cf::MAP_IN_MEMORY);
148 $self->activate;
146 } 149 }
147} 150}
148 151
149sub post_load { 152sub post_load {
150 my ($self) = @_; 153 my ($self) = @_;
151 154
155 {
152 my $guard = cf::lock_acquire "ext::world_gridmap"; 156 my $guard = cf::lock_acquire "ext::world_gridmap";
153 157
154 my ($x, $y) = $self->wxwy; 158 my ($x, $y) = $self->wxwy;
155 159
156 if ($x >= 100 && $x <= 129 && $y >= 100 && $y <= 129) { 160 if ($x >= 100 && $x <= 129 && $y >= 100 && $y <= 129) {
157 my $stride = $WORLD->{grid_w} * $WORLD->{tile_w}; 161 my $stride = $WORLD->{grid_w} * $WORLD->{tile_w};
158 my $top = ($y - 100) * $WORLD->{tile_h} * $stride 162 my $top = ($y - 100) * $WORLD->{tile_h} * $stride
159 + ($x - 100) * $WORLD->{tile_w}; 163 + ($x - 100) * $WORLD->{tile_w};
160 164
161 $self->add_underlay ($WORLD->{arc_data}, $top, $stride, $WORLD->{arc_plt}); 165 $self->add_underlay ($WORLD->{arc_data}, $top, $stride, $WORLD->{arc_plt});
162 $self->set_regiondata ($WORLD->{reg_data}, $top, $stride, $WORLD->{reg_plt}); 166 $self->set_regiondata ($WORLD->{reg_data}, $top, $stride, $WORLD->{reg_plt});
163 167
164 } else { 168 } else {
165 $self->fill; 169 $self->fill;
170 }
166 } 171 }
172
173 $self->create_region_treasure
174 if delete $self->{need_create_treasure};
167} 175}
168 176
1691 1771
170 178

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines