diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-08-11 00:20:28 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-08-11 00:20:28 +0200 |
commit | 47c928cab7d1ff73e50925bc7ef50586b6ec9821 (patch) | |
tree | e267ba521071e0d355eb6ed02a06791fd6e4552f /src/ClientHandle.cpp | |
parent | Added a comment and simplified code. (diff) | |
download | cuberite-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/ClientHandle.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 37d7edbc1..d386f3576 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -342,13 +342,7 @@ void cClientHandle::Authenticate(const AString & a_Name, const AString & a_UUID, } // Send time: - Int64 TimeOfDay = World->GetTimeOfDay(); - if (!World->IsDaylightCycleEnabled()) - { - // 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); + m_Protocol->SendTimeUpdate(World->GetWorldAge(), World->GetTimeOfDay(), World->IsDaylightCycleEnabled()); // Send contents of the inventory window m_Protocol->SendWholeInventory(*m_Player->GetWindow()); @@ -2595,9 +2589,9 @@ void cClientHandle::SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ) -void cClientHandle::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay) +void cClientHandle::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle) { - m_Protocol->SendTimeUpdate(a_WorldAge, a_TimeOfDay); + m_Protocol->SendTimeUpdate(a_WorldAge, a_TimeOfDay, a_DoDaylightCycle); } |