summaryrefslogtreecommitdiff
path: root/src/emerge.cpp
diff options
context:
space:
mode:
authorzeuner <github@quidecco.de>2017-03-17 21:28:43 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-03-17 21:28:43 +0100
commitba0a8dabeff92ecd87d28b4b5b4010e958be5851 (patch)
tree9fc04b175198d937c304119022c5a24fb5c9604c /src/emerge.cpp
parentd31750cb9375a961bf225ede210435751edfe7c9 (diff)
downloadminetest-ba0a8dabeff92ecd87d28b4b5b4010e958be5851.tar.gz
minetest-ba0a8dabeff92ecd87d28b4b5b4010e958be5851.tar.bz2
minetest-ba0a8dabeff92ecd87d28b4b5b4010e958be5851.zip
avoid crashing when accessing mapgen early (#5384)
Diffstat (limited to 'src/emerge.cpp')
-rw-r--r--src/emerge.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/emerge.cpp b/src/emerge.cpp
index 8719a9eb3..a3efb09e7 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -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;