summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol14x.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-08-11 00:20:28 +0200
committerHowaner <franzi.moos@googlemail.com>2014-08-11 00:20:28 +0200
commit47c928cab7d1ff73e50925bc7ef50586b6ec9821 (patch)
treee267ba521071e0d355eb6ed02a06791fd6e4552f /src/Protocol/Protocol14x.cpp
parentAdded a comment and simplified code. (diff)
downloadcuberite-47c928cab7d1ff73e50925bc7ef50586b6ec9821.tar
cuberite-47c928cab7d1ff73e50925bc7ef50586b6ec9821.tar.gz
cuberite-47c928cab7d1ff73e50925bc7ef50586b6ec9821.tar.bz2
cuberite-47c928cab7d1ff73e50925bc7ef50586b6ec9821.tar.lz
cuberite-47c928cab7d1ff73e50925bc7ef50586b6ec9821.tar.xz
cuberite-47c928cab7d1ff73e50925bc7ef50586b6ec9821.tar.zst
cuberite-47c928cab7d1ff73e50925bc7ef50586b6ec9821.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol14x.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Protocol/Protocol14x.cpp b/src/Protocol/Protocol14x.cpp
index 8b177ea48..3b6b6a42a 100644
--- a/src/Protocol/Protocol14x.cpp
+++ b/src/Protocol/Protocol14x.cpp
@@ -130,8 +130,14 @@ void cProtocol142::SendSoundParticleEffect(int a_EffectID, int a_SrcX, int a_Src
-void cProtocol142::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay)
+void cProtocol142::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle)
{
+ if (!a_DoDaylightCycle)
+ {
+ // When writing a "-" before the number the client ignores it but it will stop the client-side time expiration.
+ a_TimeOfDay = std::min(-a_TimeOfDay, -1LL);
+ }
+
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_UPDATE_TIME);
WriteInt64(a_WorldAge);