--- deliantra/server/ext/map-world.ext 2008/09/23 04:29:11 1.34 +++ deliantra/server/ext/map-world.ext 2010/05/04 21:45:42 1.39 @@ -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::post_init { +{ 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]); } @@ -177,5 +179,3 @@ if delete $self->{need_create_treasure}; } -1 -