aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp
index b8a99f6ae..456edfeb8 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -653,7 +653,12 @@ void Server::AsyncRunStep(bool initial_step)
}
m_clients.step(dtime);
- m_lag_gauge->increment((m_lag_gauge->get() > dtime ? -1 : 1) * dtime/100);
+ // increase/decrease lag gauge gradually
+ if (m_lag_gauge->get() > dtime) {
+ m_lag_gauge->decrement(dtime/100);
+ } else {
+ m_lag_gauge->increment(dtime/100);
+ }
#if USE_CURL
// send masterserver announce
{