Browse Source

fix lightning at transition from night to day

Kolja Strohm 9 months ago
parent
commit
11583605af
1 changed files with 3 additions and 1 deletions
  1. 3 1
      FactoryCraft/World.cpp

+ 3 - 1
FactoryCraft/World.cpp

@@ -280,7 +280,9 @@ void World::onTick(double time)
     else if (this->time > dayLength + transitionLength + nightLength)
     {
         dayLightFactor
-            = (float)((this->time - dayLength) / transitionLength) * 0.95f
+            = (float)((this->time - dayLength - nightLength - transitionLength)
+                      / transitionLength)
+                * 0.95f
             + 0.05f;
     }
     else