aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/defaultsettings.cpp2
-rw-r--r--src/emerge.cpp3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 0e82c4e2f..4307f7610 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -187,7 +187,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("emergequeue_limit_total", "256");
settings->setDefault("emergequeue_limit_diskonly", "");
settings->setDefault("emergequeue_limit_generate", "");
- settings->setDefault("num_emerge_threads", "");
+ settings->setDefault("num_emerge_threads", "1");
// physics stuff
settings->setDefault("movement_acceleration_default", "3");
diff --git a/src/emerge.cpp b/src/emerge.cpp
index dd97734c5..dc2bb3e99 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -56,8 +56,7 @@ EmergeManager::EmergeManager(IGameDef *gamedef, BiomeDefManager *bdef) {
if (g_settings->get("num_emerge_threads").empty()) {
int nprocs = porting::getNumberOfProcessors();
// leave a proc for the main thread and one for some other misc threads
- if (nprocs > 2)
- nthreads = nprocs - 2;
+ nthreads = (nprocs > 2) ? nthreads = nprocs - 2 : 1;
} else {
nthreads = g_settings->getU16("num_emerge_threads");
}