aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkwolekr <mirrorisim@gmail.com>2013-02-23 22:06:16 -0500
committerkwolekr <mirrorisim@gmail.com>2013-02-25 23:11:00 -0500
commitf00d136ab1523297fdf4707bbc5d40ec9d4f7afb (patch)
treee6e79c95fe11613e711301aa914dd0bda8885504 /src
parent28c50c16cdeda7de39ed15c17094f3de01287d4c (diff)
downloadminetest-f00d136ab1523297fdf4707bbc5d40ec9d4f7afb.tar.gz
minetest-f00d136ab1523297fdf4707bbc5d40ec9d4f7afb.tar.bz2
minetest-f00d136ab1523297fdf4707bbc5d40ec9d4f7afb.zip
Fix selection of # threads, set default to 1 thread
Diffstat (limited to 'src')
-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");
}