mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
avoid crashing when accessing mapgen early (#5384)
This commit is contained in:
parent
d31750cb93
commit
ba0a8dabef
1 changed files with 3 additions and 0 deletions
|
@ -174,6 +174,9 @@ bool EmergeManager::initMapgens(MapgenParams *params)
|
||||||
|
|
||||||
Mapgen *EmergeManager::getCurrentMapgen()
|
Mapgen *EmergeManager::getCurrentMapgen()
|
||||||
{
|
{
|
||||||
|
if (!m_threads_active)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
for (u32 i = 0; i != m_threads.size(); i++) {
|
for (u32 i = 0; i != m_threads.size(); i++) {
|
||||||
if (m_threads[i]->isCurrentThread())
|
if (m_threads[i]->isCurrentThread())
|
||||||
return m_threads[i]->m_mapgen;
|
return m_threads[i]->m_mapgen;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue