Tooltips: Unify the tooltip[] and list[] description tooltip display functions (...
[oweals/minetest.git] / src / emerge.cpp
index 3f0a46010c7bf320e23b9063c6967eb706afe489..d24971e44a099490dfaeca4938d7c618e0c3343d 100644 (file)
@@ -40,7 +40,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "mg_schematic.h"
 #include "nodedef.h"
 #include "profiler.h"
-#include "scripting_game.h"
+#include "scripting_server.h"
 #include "server.h"
 #include "serverobject.h"
 #include "settings.h"
@@ -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;
@@ -564,7 +567,7 @@ MapBlock *EmergeThread::finishGen(v3s16 pos, BlockMakeData *bmdata,
                m_server->getScriptIface()->environment_OnGenerated(
                        minp, maxp, m_mapgen->blockseed);
        } catch (LuaError &e) {
-               m_server->setAsyncFatalError("Lua: " + std::string(e.what()));
+               m_server->setAsyncFatalError("Lua: finishGen" + std::string(e.what()));
        }
 
        EMERGE_DBG_OUT("ended up with: " << analyze_block(block));
@@ -603,7 +606,7 @@ void *EmergeThread::run()
                        continue;
                }
 
-               if (blockpos_over_limit(pos))
+               if (blockpos_over_max_limit(pos))
                        continue;
 
                bool allow_gen = bedata.flags & BLOCK_EMERGE_ALLOW_GEN;