diff --git a/assets/mods/basegame/weathers/clut_daylight.tga b/assets/mods/basegame/weathers/clut_daylight.tga index 056655cf3..9e0249bcf 100644 --- a/assets/mods/basegame/weathers/clut_daylight.tga +++ b/assets/mods/basegame/weathers/clut_daylight.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0b439c9beeb44162e30538c2b0ed8ea433a9e3e4805218125f222ecd2d8c928f +oid sha256:a405207ec8adb91aed3e30df8046b74582aac089785b85d67600201fea5189aa size 2418 diff --git a/src/net/torvald/terrarum/weather/WeatherMixer.kt b/src/net/torvald/terrarum/weather/WeatherMixer.kt index de52e3fed..ddd171709 100644 --- a/src/net/torvald/terrarum/weather/WeatherMixer.kt +++ b/src/net/torvald/terrarum/weather/WeatherMixer.kt @@ -270,12 +270,14 @@ internal object WeatherMixer : RNGConsumer { val pSx: Int; val pSy: Int; val pNx: Int; val pNy: Int if (timeOfDay < HALF_DAY) { - pSx = pStartRaw; pSy = 0 + pSx = pStartRaw.coerceIn(0 until colorMap.width) + pSy = 0 if (pSx == colorMap.width-1) { pNx = pSx; pNy = 1 } - else { pNx = pNextRaw; pNy = 0 } + else { pNx = pSx + 1; pNy = 0 } } else { - pSx = pStartRaw; pSy = 1 + pSx = (pStartRaw + 1).coerceIn(0 until colorMap.width) + pSy = 1 if (pSx == 0) { pNx = 0; pNy = 0 } else { pNx = pSx - 1; pNy = 1 } }