1
0

Added a comment and simplified code.

This commit is contained in:
Howaner 2014-08-10 20:06:03 +02:00
parent f90078c09f
commit 42bad0edec
2 changed files with 5 additions and 11 deletions

View File

@ -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);

View File

@ -2253,11 +2253,8 @@ void cWorld::BroadcastTimeUpdate(const cClientHandle * a_Exclude)
int TimeOfDay = m_TimeOfDay;
if (!m_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);
}
cCSLock Lock(m_CSPlayers);