Răsfoiți Sursa

fix lightning at transition from night to day

Kolja Strohm 1 an în urmă
părinte
comite
11583605af
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  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