summaryrefslogtreecommitdiffstats
path: root/src/GameState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GameState.cpp')
-rw-r--r--src/GameState.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/GameState.cpp b/src/GameState.cpp
index c42092a..fabfdb8 100644
--- a/src/GameState.cpp
+++ b/src/GameState.cpp
@@ -58,6 +58,9 @@ void GameState::Update(float deltaTime) {
isBlockSelected = raycast.isHit;
raycastHit = raycast.hitPos;
+
+ if (doDaylightCycle)
+ interpolatedTimeOfDay += 20.0 * deltaTime;
}
}
@@ -433,8 +436,10 @@ void GameState::UpdatePacket(std::shared_ptr<Packet> ptr) {
case TimeUpdate: {
auto packet = std::static_pointer_cast<PacketTimeUpdate>(ptr);
+ doDaylightCycle = TimeOfDay != packet->TimeOfDay;
WorldAge = packet->WorldAge;
TimeOfDay = packet->TimeOfDay;
+ interpolatedTimeOfDay = TimeOfDay;
break;
}