set generation/meshing queue flags before pushing to queues

fix-multithread
EmaMaker 2023-10-03 12:30:57 +02:00
parent ca44c0f284
commit da6ceeb605
1 changed files with 2 additions and 2 deletions

View File

@ -157,8 +157,8 @@ namespace chunkmanager
if(!c->getState(Chunk::CHUNK_STATE_GENERATED)){ if(!c->getState(Chunk::CHUNK_STATE_GENERATED)){
if(!c->getState(Chunk::CHUNK_STATE_IN_GENERATION_QUEUE)){ if(!c->getState(Chunk::CHUNK_STATE_IN_GENERATION_QUEUE)){
// Generate // Generate
chunks_to_generate_queue.push(std::make_pair(c, GENERATION_PRIORITY_NORMAL));
c->setState(Chunk::CHUNK_STATE_IN_GENERATION_QUEUE, true); c->setState(Chunk::CHUNK_STATE_IN_GENERATION_QUEUE, true);
chunks_to_generate_queue.push(std::make_pair(c, GENERATION_PRIORITY_NORMAL));
} }
}else{ }else{
gen++; gen++;
@ -167,8 +167,8 @@ namespace chunkmanager
if(!c->getState(Chunk::CHUNK_STATE_MESHED)){ if(!c->getState(Chunk::CHUNK_STATE_MESHED)){
if(!c->getState(Chunk::CHUNK_STATE_IN_MESHING_QUEUE)){ if(!c->getState(Chunk::CHUNK_STATE_IN_MESHING_QUEUE)){
// Mesh // Mesh
chunks_to_mesh_queue.push(std::make_pair(c, MESHING_PRIORITY_NORMAL));
c->setState(Chunk::CHUNK_STATE_IN_MESHING_QUEUE, true); c->setState(Chunk::CHUNK_STATE_IN_MESHING_QUEUE, true);
chunks_to_mesh_queue.push(std::make_pair(c, MESHING_PRIORITY_NORMAL));
} }
}else{ }else{
mesh++; mesh++;