summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-08-10 20:06:03 +0200
committerHowaner <franzi.moos@googlemail.com>2014-08-10 20:06:03 +0200
commit42bad0edec58f42e4072360c52870d3be9ced3c5 (patch)
tree782cd9149c3a0472ec332e2a06c9d8c86e9181d8 /src/ClientHandle.cpp
parentAdded IsDaylightCycleEnabled saving. (diff)
downloadcuberite-42bad0edec58f42e4072360c52870d3be9ced3c5.tar
cuberite-42bad0edec58f42e4072360c52870d3be9ced3c5.tar.gz
cuberite-42bad0edec58f42e4072360c52870d3be9ced3c5.tar.bz2
cuberite-42bad0edec58f42e4072360c52870d3be9ced3c5.tar.lz
cuberite-42bad0edec58f42e4072360c52870d3be9ced3c5.tar.xz
cuberite-42bad0edec58f42e4072360c52870d3be9ced3c5.tar.zst
cuberite-42bad0edec58f42e4072360c52870d3be9ced3c5.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 286c17513..37d7edbc1 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -341,15 +341,12 @@ void cClientHandle::Authenticate(const AString & a_Name, const AString & a_UUID,
m_Protocol->SendWeather(World->GetWeather());
}
- // Send time
+ // Send time:
Int64 TimeOfDay = World->GetTimeOfDay();
if (!World->IsDaylightCycleEnabled())
{
- TimeOfDay *= -1;
- if (TimeOfDay == 0)
- {
- TimeOfDay = -1;
- }
+ // When writing a "-" before the number the client ignores it but it will stop the client-side time expiration.
+ TimeOfDay = std::min(-TimeOfDay, -1);
}
m_Protocol->SendTimeUpdate(World->GetWorldAge(), TimeOfDay);