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.2 by root, Sat Jan 20 23:39:08 2007 UTC vs.
Revision 1.3 by root, Sun Jan 21 13:08:36 2007 UTC

36 $self->tile_path (0, sprintf "/world/world_%03d_%03d", $x, $y - 1) if $y > 0; 36 $self->tile_path (0, sprintf "/world/world_%03d_%03d", $x, $y - 1) if $y > 0;
37 $self->tile_path (1, sprintf "/world/world_%03d_%03d", $x + 1, $y) if $x < 999; 37 $self->tile_path (1, sprintf "/world/world_%03d_%03d", $x + 1, $y) if $x < 999;
38 $self->tile_path (2, sprintf "/world/world_%03d_%03d", $x, $y + 1) if $y < 999; 38 $self->tile_path (2, sprintf "/world/world_%03d_%03d", $x, $y + 1) if $y < 999;
39 $self->tile_path (3, sprintf "/world/world_%03d_%03d", $x - 1, $y) if $x > 0; 39 $self->tile_path (3, sprintf "/world/world_%03d_%03d", $x - 1, $y) if $x > 0;
40 40
41 $self->outdoor (1);
42
41 $self->msg ("worldmap dynamically created by map-world extension"); 43 $self->msg ("worldmap dynamically created by map-world extension");
42 44
43 #TODO: region 45 #TODO: region
44 46
45 $self->{load_path} = sprintf "%s/%s/world-overlay/world_%03d_%03d", cf::datadir, cf::mapdir, $x, $y 47 $self->{load_path} = sprintf "%s/%s/world-overlay/world_%03d_%03d", cf::datadir, cf::mapdir, $x, $y
69 71
70 $self->in_memory (cf::MAP_IN_MEMORY); 72 $self->in_memory (cf::MAP_IN_MEMORY);
71 } 73 }
72} 74}
73 75
74sub pre_load { 76sub post_load {
75 my ($self) = @_; 77 my ($self) = @_;
76 78
77 my ($x, $y) = $self->wxwy; 79 my ($x, $y) = $self->wxwy;
78 80
79 my $stride = ($WORLD->{maxx} - $WORLD->{minx} + 1) * $WORLD->{tilew}; 81 my $stride = ($WORLD->{maxx} - $WORLD->{minx} + 1) * $WORLD->{tilew};
82 84
83 for my $Y (0 .. $WORLD->{tileh} - 1) { 85 for my $Y (0 .. $WORLD->{tileh} - 1) {
84 Coro::cede; 86 Coro::cede;
85 my $row = substr $WORLD->{data}, $top + $Y * $stride, $WORLD->{tilew}; 87 my $row = substr $WORLD->{data}, $top + $Y * $stride, $WORLD->{tilew};
86 for my $X (0 .. $WORLD->{tilew} - 1) { 88 for my $X (0 .. $WORLD->{tilew} - 1) {
89 next if grep $_->flag (cf::FLAG_IS_FLOOR), $self->at ($X, $Y);
87 my $ob = cf::object::new $WORLD->{arch}[ord substr $row, $X]; 90 my $ob = cf::object::new $WORLD->{arch}[ord substr $row, $X];
91 $ob->flag (cf::FLAG_NO_MAP_SAVE, 1);
88 $self->insert ($ob, $X, $Y); 92 $self->insert ($ob, $X, $Y);
89 } 93 }
90 } 94 }
91
92 $self->set_object_flag (cf::FLAG_NO_MAP_SAVE, 1);
93} 95}
94 96
951 971
96 98

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines