--- deliantra/server/ext/map-world.ext 2007/12/05 11:08:34 1.32 +++ deliantra/server/ext/map-world.ext 2010/04/29 07:32:34 1.38 @@ -83,18 +83,20 @@ sub reload() { $WORLD = load_gridmap "$MAPDIR/world"; - warn "worldmap gridmap loaded."; + cf::trace "worldmap gridmap loaded.\n"; } -# this is contorted, but likely the correct way to acquire the lock :) -cf::sync_job { +{ my $guard = cf::lock_acquire "ext::world_gridmap"; - cf::async_ext { - $Coro::current->{desc} = "worldmap loader"; - reload; - undef $guard; + + cf::post_init { + cf::async_ext { + $Coro::current->{desc} = "worldmap loader"; + reload; + undef $guard; + }; }; -}; +} sub wxwy { $_[0]->path =~ m{/world/world_(\d\d\d)_(\d\d\d)$} @@ -135,7 +137,7 @@ sub fill { my ($self) = @_; - $self->add_underlay ("\x00" x ($WORLD->{tile_w} * $WORLD->{tile_h}), 0, $WORLD->{tile_w}, $WORLD->{arc_plt}); + $self->add_underlay ("\x00" x ($WORLD->{tile_w} * $WORLD->{tile_h}), 0, $WORLD->{tile_w}, $WORLD->{arc_plt});#d# $self->default_region (cf::region::find $WORLD->{reg_plt}[0]); } @@ -147,7 +149,7 @@ } else { $self->alloc; $self->fill; - $self->in_memory (cf::MAP_IN_MEMORY); + $self->in_memory (cf::MAP_ACTIVE); $self->activate; } }