num_emerge_threads: Initialise value to cope with setting syntax error (#8396)
authorParamat <paramat@users.noreply.github.com>
Mon, 18 Mar 2019 10:19:53 +0000 (10:19 +0000)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Mon, 18 Mar 2019 10:19:53 +0000 (11:19 +0100)
src/emerge.cpp

index 0ad6ee29b9d7d57ff202ef5d07c2ceb1d7d902e9..0a18529855a3675b5a51368474b3454f7f43630c 100644 (file)
@@ -128,10 +128,10 @@ EmergeManager::EmergeManager(Server *server)
 
        enable_mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info");
 
-       // If unspecified, leave a proc for the main thread and one for
-       // some other misc thread
-       s16 nthreads;
+       s16 nthreads = 1;
        g_settings->getS16NoEx("num_emerge_threads", nthreads);
+       // If automatic, leave a proc for the main thread and one for
+       // some other misc thread
        if (nthreads == 0)
                nthreads = Thread::getNumberOfProcessors() - 2;
        if (nthreads < 1)