avoid crashing when accessing mapgen early ()

This commit is contained in:
zeuner 2017-03-17 21:28:43 +01:00 committed by Loïc Blot
parent d31750cb93
commit ba0a8dabef

@ -174,6 +174,9 @@ bool EmergeManager::initMapgens(MapgenParams *params)
Mapgen *EmergeManager::getCurrentMapgen()
{
if (!m_threads_active)
return NULL;
for (u32 i = 0; i != m_threads.size(); i++) {
if (m_threads[i]->isCurrentThread())
return m_threads[i]->m_mapgen;