easily reproducible with a high num_emerge_threads and /emergeblocks
return nullptr;
for (u32 i = 0; i != m_threads.size(); i++) {
- if (m_threads[i]->isCurrentThread())
- return m_threads[i]->m_mapgen;
+ EmergeThread *t = m_threads[i];
+ if (t->isRunning() && t->isCurrentThread())
+ return t->m_mapgen;
}
return nullptr;
/*
Clear generate notifier events
*/
- Mapgen *mg = m_emerge->getCurrentMapgen();
- mg->gennotify.clearEvents();
+ m_mapgen->gennotify.clearEvents();
EMERGE_DBG_OUT("ended up with: " << analyze_block(block));