summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol14x.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-08-14 01:04:01 +0200
committermadmaxoft <github@xoft.cz>2014-08-14 01:04:01 +0200
commit45068f9bf45fe952429bd200d9d9d747eeba61e8 (patch)
tree94adc35088c801f5f1842aa95578b06831da6b53 /src/Protocol/Protocol14x.cpp
parentRankMgr: Fixed multithreading issues. (diff)
parentCheckBasicStyle checks the src folder as well. (diff)
downloadcuberite-45068f9bf45fe952429bd200d9d9d747eeba61e8.tar
cuberite-45068f9bf45fe952429bd200d9d9d747eeba61e8.tar.gz
cuberite-45068f9bf45fe952429bd200d9d9d747eeba61e8.tar.bz2
cuberite-45068f9bf45fe952429bd200d9d9d747eeba61e8.tar.lz
cuberite-45068f9bf45fe952429bd200d9d9d747eeba61e8.tar.xz
cuberite-45068f9bf45fe952429bd200d9d9d747eeba61e8.tar.zst
cuberite-45068f9bf45fe952429bd200d9d9d747eeba61e8.zip
Diffstat (limited to 'src/Protocol/Protocol14x.cpp')
-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);