aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-12-05 14:40:30 +0100
committerGitHub <noreply@github.com>2021-12-05 14:40:30 +0100
commitff934d538c00518476c31f5df6ebc4be5ca79591 (patch)
treef4e261ef192fe4410fc1f5e56e04d8c7645d92dc /src/server.cpp
parent7a043b3ebbbf250890f39a9afecebba1cc9826a6 (diff)
downloadminetest-ff934d538c00518476c31f5df6ebc4be5ca79591.tar.gz
minetest-ff934d538c00518476c31f5df6ebc4be5ca79591.tar.bz2
minetest-ff934d538c00518476c31f5df6ebc4be5ca79591.zip
Fix various code & correctness issues (#11815)
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 5022221ee..c175cbcd2 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -517,9 +517,7 @@ void Server::stop()
// Stop threads (set run=false first so both start stopping)
m_thread->stop();
- //m_emergethread.setRun(false);
m_thread->wait();
- //m_emergethread.stop();
infostream<<"Server: Threads stopped"<<std::endl;
}
@@ -954,14 +952,14 @@ void Server::AsyncRunStep(bool initial_step)
}
/*
- Trigger emergethread (it somehow gets to a non-triggered but
- bysy state sometimes)
+ Trigger emerge thread
+ Doing this every 2s is left over from old code, unclear if this is still needed.
*/
{
float &counter = m_emergethread_trigger_timer;
- counter += dtime;
- if (counter >= 2.0) {
- counter = 0.0;
+ counter -= dtime;
+ if (counter <= 0.0f) {
+ counter = 2.0f;
m_emerge->startThreads();
}