… | |
… | |
85 | $WORLD = load_gridmap "$MAPDIR/world"; |
85 | $WORLD = load_gridmap "$MAPDIR/world"; |
86 | warn "worldmap gridmap loaded."; |
86 | warn "worldmap gridmap loaded."; |
87 | } |
87 | } |
88 | |
88 | |
89 | # this is contorted, but likely the correct way to acquire the lock :) |
89 | # this is contorted, but likely the correct way to acquire the lock :) |
90 | cf::sync_job { |
90 | cf::post_init { |
91 | my $guard = cf::lock_acquire "ext::world_gridmap"; |
91 | my $guard = cf::lock_acquire "ext::world_gridmap"; |
92 | cf::async_ext { |
92 | cf::async_ext { |
93 | $Coro::current->{desc} = "worldmap loader"; |
93 | $Coro::current->{desc} = "worldmap loader"; |
94 | reload; |
94 | reload; |
95 | undef $guard; |
95 | undef $guard; |
… | |
… | |
145 | if ($self->{load_path}) { |
145 | if ($self->{load_path}) { |
146 | $self->SUPER::load; |
146 | $self->SUPER::load; |
147 | } else { |
147 | } else { |
148 | $self->alloc; |
148 | $self->alloc; |
149 | $self->fill; |
149 | $self->fill; |
150 | $self->in_memory (cf::MAP_IN_MEMORY); |
150 | $self->in_memory (cf::MAP_ACTIVE); |
151 | $self->activate; |
151 | $self->activate; |
152 | } |
152 | } |
153 | } |
153 | } |
154 | |
154 | |
155 | sub post_load { |
155 | sub post_load { |